瀏覽代碼

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>
Jesper Juhl 13 年之前
父節點
當前提交
e3b09e4bf6
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/staging/vt6656/wpactl.c

+ 1 - 0
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;
 	}