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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
default:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wpa_ioctl: unknown cmd=%d\n",
param->cmd);
+ kfree(param);
return -EOPNOTSUPP;
}