Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75ebd645 authored by Tushnim Bhattacharyya's avatar Tushnim Bhattacharyya Committed by nshrivas
Browse files

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
parent 3e7ca73a
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -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);
@@ -892,15 +893,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;
@@ -911,6 +904,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");
@@ -985,6 +983,13 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data)
	}
}

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)
{