mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
qcacld-3.0: Fix memory leak in HDD API iw_setnone_getint
HDD IOCTL __iw_setnone_getint is not releasing SME config memory in error case properly and hence leading to memory leak. Fix this SME config memory leak by properly freeing it before returning from __iw_setnone_getint. Change-Id: Ie50259a639edb2cfa63cd3bbe7cac8bb8ebb7654 CRs-Fixed: 2191041
This commit is contained in:
parent
56e3c3c7e7
commit
1117fcf2af
1 changed files with 6 additions and 7 deletions
|
|
@ -7062,13 +7062,6 @@ static int __iw_setnone_getint(struct net_device *dev,
|
|||
tSmeConfigParams *sme_config;
|
||||
struct hdd_context *hdd_ctx;
|
||||
|
||||
sme_config = qdf_mem_malloc(sizeof(*sme_config));
|
||||
if (!sme_config) {
|
||||
hdd_err("failed to allocate memory for sme_config");
|
||||
return -ENOMEM;
|
||||
}
|
||||
qdf_mem_zero(sme_config, sizeof(*sme_config));
|
||||
|
||||
ENTER_DEV(dev);
|
||||
|
||||
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
|
|
@ -7080,6 +7073,12 @@ static int __iw_setnone_getint(struct net_device *dev,
|
|||
if (0 != ret)
|
||||
return ret;
|
||||
|
||||
sme_config = qdf_mem_malloc(sizeof(*sme_config));
|
||||
if (!sme_config) {
|
||||
hdd_err("failed to allocate memory for sme_config");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
switch (value[0]) {
|
||||
case WE_GET_11D_STATE:
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue