From: Jesper Juhl Date: Mon, 16 Jan 2012 20:28:37 +0000 (+0100) Subject: staging, vt6656/wpactl.c: Fix mem leak in wpa_ioctl() X-Git-Tag: MMI-PSA29.97-13-9~17268^2~176^2~89 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e3b09e4bf6455caccc7ef215256e4f0065fbca7d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Greg Kroah-Hartman --- 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; }