summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CORE/HDD/src/wlan_hdd_ftm.c4
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c11
2 files changed, 7 insertions, 8 deletions
diff --git a/CORE/HDD/src/wlan_hdd_ftm.c b/CORE/HDD/src/wlan_hdd_ftm.c
index 71ab148e354f..d0762a8f93ae 100644
--- a/CORE/HDD/src/wlan_hdd_ftm.c
+++ b/CORE/HDD/src/wlan_hdd_ftm.c
@@ -841,10 +841,6 @@ int wlan_hdd_ftm_close(hdd_context_t *pHddCtx)
VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
}
- //Free up dynamically allocated members inside HDD Adapter
- kfree(pHddCtx->cfg_ini);
- pHddCtx->cfg_ini= NULL;
-
#if defined(QCA_WIFI_FTM) && defined(LINUX_QCMBR)
spin_lock_bh(&qcmbr_queue_lock);
if (!list_empty(&qcmbr_queue_head)) {
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 0a0e72c397da..50f678431f86 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -11717,10 +11717,6 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx)
#ifdef IPA_OFFLOAD
hdd_ipa_cleanup(pHddCtx);
#endif
- //Free up dynamically allocated members inside HDD Adapter
- kfree(pHddCtx->cfg_ini);
- pHddCtx->cfg_ini= NULL;
-
/* free the power on lock from platform driver */
if (free_riva_power_on_lock("wlan"))
@@ -11734,6 +11730,13 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx)
hdd_list_destroy(&pHddCtx->hdd_roc_req_q);
free_hdd_ctx:
+
+ /* Free up dynamically allocated members inside HDD Adapter */
+ if (pHddCtx->cfg_ini) {
+ kfree(pHddCtx->cfg_ini);
+ pHddCtx->cfg_ini= NULL;
+ }
+
/* FTM mode, WIPHY did not registered
If un-register here, system crash will happen */
if (VOS_FTM_MODE != hdd_get_conparam())