diff options
| author | Ashish Kumar Dhanotiya <adhanoti@codeaurora.org> | 2019-06-06 12:40:17 +0530 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2019-06-10 02:29:00 -0700 |
| commit | 6f7bb6f3fd25d2facdc87df9c8dbf7c1a1b8eac1 (patch) | |
| tree | 4d05244db48547dae3c04ee659da1117ebb3683d | |
| parent | a495bee111344050a5baf90742ac02e00c806b45 (diff) | |
qcacld-3.0: Possible memory leak in set dwell time api
Dynamically allocated memory is not freed in error case
for sme_config in set dwell time api, this may lead to
mem leak in error case.
Free the dynamically alolocated memory in error case.
Change-Id: Id74c28fbe5600495c86d2e0e8cc2b6809f5b3b48
CRs-Fixed: 2466253
| -rw-r--r-- | core/hdd/src/wlan_hdd_ioctl.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 9e89e85a3aef..d4e019f5bb0d 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -2323,9 +2323,10 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) sme_get_config_param(hHal, sme_config); if (strncmp(command, "SETDWELLTIME ACTIVE MAX", 23) == 0) { - if (drv_cmd_validate(command, 23)) - return -EINVAL; - + if (drv_cmd_validate(command, 23)) { + retval = -EINVAL; + goto free; + } value = value + 24; temp = kstrtou32(value, 10, &val); if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_MIN || @@ -2338,8 +2339,10 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) sme_config->csrConfig.nActiveMaxChnTime = val; sme_update_config(hHal, sme_config); } else if (strncmp(command, "SETDWELLTIME ACTIVE MIN", 23) == 0) { - if (drv_cmd_validate(command, 23)) - return -EINVAL; + if (drv_cmd_validate(command, 23)) { + retval = -EINVAL; + goto free; + } value = value + 24; temp = kstrtou32(value, 10, &val); @@ -2353,8 +2356,10 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) sme_config->csrConfig.nActiveMinChnTime = val; sme_update_config(hHal, sme_config); } else if (strncmp(command, "SETDWELLTIME PASSIVE MAX", 24) == 0) { - if (drv_cmd_validate(command, 24)) - return -EINVAL; + if (drv_cmd_validate(command, 24)) { + retval = -EINVAL; + goto free; + } value = value + 25; temp = kstrtou32(value, 10, &val); @@ -2368,8 +2373,10 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) sme_config->csrConfig.nPassiveMaxChnTime = val; sme_update_config(hHal, sme_config); } else if (strncmp(command, "SETDWELLTIME PASSIVE MIN", 24) == 0) { - if (drv_cmd_validate(command, 24)) - return -EINVAL; + if (drv_cmd_validate(command, 24)) { + retval = -EINVAL; + goto free; + } value = value + 25; temp = kstrtou32(value, 10, &val); @@ -2383,8 +2390,10 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) sme_config->csrConfig.nPassiveMinChnTime = val; sme_update_config(hHal, sme_config); } else if (strncmp(command, "SETDWELLTIME", 12) == 0) { - if (drv_cmd_validate(command, 12)) - return -EINVAL; + if (drv_cmd_validate(command, 12)) { + retval = -EINVAL; + goto free; + } value = value + 13; temp = kstrtou32(value, 10, &val); |
