From c90aaa122dae146614960f6f11db2e27966d4765 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Wed, 14 Nov 2018 11:56:58 +0530 Subject: [PATCH] qcacld-3.0: memset mac_context on mac close on mac_close, current global mac_context is not getting memset to zero, so when new mac_open occures this global mac_context contains the previous configuration which leads to undefined behaviour. Initially during load time, driver type is set as production in global mac context, on change of the con_mod to FTM, this driver type is chnaged to MFG, now again if the con_mode is changed to MISSION mode or MONITOR mode this driver type should be updated to production, but since during mac_close, mac_ctx is not memset to zero, this driver type is not getting updated and having the previous value as MFG, because of this in pe mc process handler, message is not getting processed leading to mem leak at stop modules. Change-Id: I342ad5c9bd4b710c668d8121f41f5ffd98d2c221 CRs-Fixed: 2349670 --- core/mac/src/sys/legacy/src/system/src/mac_init_api.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c index bddb10cd5596..3cc7e6bdd230 100644 --- a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c +++ b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c @@ -194,6 +194,7 @@ QDF_STATUS mac_close(mac_handle_t mac_handle) wlan_objmgr_psoc_release_ref(mac->psoc, WLAN_LEGACY_MAC_ID); mac->mlme_cfg = NULL; mac->psoc = NULL; + qdf_mem_zero(mac, sizeof(*mac)); mac_free_context_buffer(); return QDF_STATUS_SUCCESS;