summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656/wpactl.c
diff options
context:
space:
mode:
authorJesper Juhl2012-01-16 21:28:37 +0100
committerGreg Kroah-Hartman2012-02-09 18:20:06 +0100
commite3b09e4bf6455caccc7ef215256e4f0065fbca7d (patch)
treee78e6e57ecdcd5b3b99773dada72bb0e79d0ab74 /drivers/staging/vt6656/wpactl.c
parentstaging, vt6656/wpactl.c: A basic style cleanup (diff)
downloadkernel-qcow2-linux-e3b09e4bf6455caccc7ef215256e4f0065fbca7d.tar.gz
kernel-qcow2-linux-e3b09e4bf6455caccc7ef215256e4f0065fbca7d.tar.xz
kernel-qcow2-linux-e3b09e4bf6455caccc7ef215256e4f0065fbca7d.zip
staging, vt6656/wpactl.c: Fix mem leak in wpa_ioctl()
If we hit the default case in the switch statement in wpa_ioctl() we'll leak the memory allocated to 'param' when the variable goes out of scope without having been assigned to anything. This patch fixes the leak by kfree()'ing the memory before we return from the function. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656/wpactl.c')
-rw-r--r--drivers/staging/vt6656/wpactl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/vt6656/wpactl.c b/drivers/staging/vt6656/wpactl.c
index 9d1486866352..5435e8205b2c 100644
--- a/drivers/staging/vt6656/wpactl.c
+++ b/drivers/staging/vt6656/wpactl.c
@@ -902,6 +902,7 @@ 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);
+ kfree(param);
return -EOPNOTSUPP;
}