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:
Rajeev Kumar 2018-02-15 16:25:19 -08:00 • committed by snandini
commit 1117fcf2af

View file

@ -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:
{