staging: vt6655: Fix memory leak in wpa_ioctl()
authorChristian Engelmayer <cengelma@gmx.at>
Sat, 11 Jan 2014 22:35:04 +0000 (23:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Jan 2014 23:19:41 +0000 (15:19 -0800)
Fix a memory leak in the wpa_ioctl() error handling path so that 'param' is
also freed correctly in case of an unsupported ioctl.
Detected by Coverity: CID 144380.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/wpactl.c

index 7deb7a1..d17224f 100644 (file)
@@ -923,8 +923,8 @@ int wpa_ioctl(PSDevice pDevice, struct iw_point *p)
        default:
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wpa_ioctl: unknown cmd=%d\n",
                        param->cmd);
-               return -EOPNOTSUPP;
-               break;
+               ret = -EOPNOTSUPP;
+               goto out;
        }
 
        if ((ret == 0) && wpa_ioctl) {