From 081c66cfde6cc13dd8a334e390664a05f844f470 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Thu, 19 Sep 2019 14:44:35 +0530 Subject: [PATCH] qcacld-3.0: Free Sap acs ch list memory in stop adapter Currently the SAP memory is not freed as part of stop adapter as the sap ctx is mem zero in deinit ctx, hence the addr to free in NULL Fix is to extract the the sap config from adapter and then free the sap ch list memory from it. Change-Id: I8c0bf66765c34f0936d694d260ce1544791beecc CRs-Fixed: 2530985 --- core/hdd/src/wlan_hdd_cfg80211.c | 3 ++- core/hdd/src/wlan_hdd_hostapd.c | 2 -- core/sap/inc/sap_api.h | 2 +- core/sap/src/sap_module.c | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 7226d68ff299..c72b6521d705 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3033,7 +3033,8 @@ static int wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, */ void wlan_hdd_undo_acs(struct hdd_adapter *adapter) { - sap_undo_acs(WLAN_HDD_GET_SAP_CTX_PTR(adapter)); + sap_undo_acs(WLAN_HDD_GET_SAP_CTX_PTR(adapter), + &adapter->session.ap.sap_config); } /** diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index c10419bf9653..6f4b6ea1b31c 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -5774,8 +5774,6 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, cds_flush_work(&adapter->sap_stop_bss_work); adapter->session.ap.sap_config.acs_cfg.acs_mode = false; qdf_atomic_set(&adapter->session.ap.acs_in_progress, 0); - qdf_mem_zero(&adapter->session.ap.sap_config.acs_cfg, - sizeof(struct sap_acs_cfg)); hdd_debug("Disabling queues"); wlan_hdd_netif_queue_control(adapter, WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 6e7ae900c4c1..7f3c9b0592b4 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -1331,7 +1331,7 @@ QDF_STATUS wlansap_acs_chselect(struct sap_context *sap_context, * * Return: None */ -void sap_undo_acs(struct sap_context *sap_context); +void sap_undo_acs(struct sap_context *sap_context, struct sap_config *sap_cfg); /** * wlansap_get_chan_width() - get sap channel width. diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index bb2e467ad5e5..842923f05ab1 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -2485,14 +2485,14 @@ void wlansap_populate_del_sta_params(const uint8_t *mac, QDF_MAC_ADDR_ARRAY(params->peerMacAddr.bytes)); } -void sap_undo_acs(struct sap_context *sap_ctx) +void sap_undo_acs(struct sap_context *sap_ctx, struct sap_config *sap_cfg) { struct sap_acs_cfg *acs_cfg; if (!sap_ctx) return; - acs_cfg = sap_ctx->acs_cfg; + acs_cfg = &sap_cfg->acs_cfg; if (!acs_cfg) return;