From e269fc71f275b9567421eaa2e67be41e1867134a Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Mon, 1 Oct 2018 14:50:15 -0700 Subject: [PATCH] qcacmn: Protect sap restart work for driver unload Protect sap restart work handler from SSR to avoid accessing data structures which are freed already. Change-Id: I75d2032b022aa68817ec102cbe65f635a627eb82 CRs-Fixed: 2325966 --- .../policy_mgr/src/wlan_policy_mgr_action.c | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index 22c07a0bd777..191384b81f07 100644 --- a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -31,6 +31,7 @@ #include "qdf_types.h" #include "qdf_trace.h" #include "wlan_objmgr_global_obj.h" +#include "qdf_platform.h" enum policy_mgr_conc_next_action (*policy_mgr_get_current_pref_hw_mode_ptr) (struct wlan_objmgr_psoc *psoc); @@ -1286,15 +1287,7 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect( return true; } -/** - * policy_mgr_check_sta_ap_concurrent_ch_intf() - Restart SAP in STA-AP case - * @data: Pointer check concurrent channel work data - * - * Restarts the SAP interface in STA-AP concurrency scenario - * - * Restart: None - */ -void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) +static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) { struct wlan_objmgr_psoc *psoc; struct policy_mgr_psoc_priv_obj *pm_ctx = NULL; @@ -1305,6 +1298,11 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) uint8_t operating_channel[MAX_NUMBER_OF_CONC_CONNECTIONS]; uint8_t vdev_id[MAX_NUMBER_OF_CONC_CONNECTIONS]; + if (qdf_is_module_state_transitioning()) { + policy_mgr_err("Module transition in progress"); + goto end; + } + work_info = (struct sta_ap_intf_check_work_ctx *) data; if (!work_info) { policy_mgr_err("Invalid work_info"); @@ -1379,6 +1377,13 @@ end: } } +void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) +{ + qdf_ssr_protect(__func__); + __policy_mgr_check_sta_ap_concurrent_ch_intf(data); + qdf_ssr_unprotect(__func__); +} + static bool policy_mgr_valid_sta_channel_check(struct wlan_objmgr_psoc *psoc, uint8_t sta_channel) {