From 88dd18dba0cd4e08c206e0d7469c3eb14e68ee5e Mon Sep 17 00:00:00 2001 From: Hong Shi Date: Tue, 28 Aug 2018 15:13:32 +0800 Subject: qcacld-2.0: Fix race condition between kickout and disconnect There's race condition between kickout event and disconnect command. It cause disconnect_comp_var is not completed properly. Add check in limTearDownLinkWithAp to eliminate the race condition. Change-Id: Iebe98911cc41e8b33f8f403b75c79a75a38ca0a6 CRs-Fixed: 2304261 --- CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c b/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c index 901f4aa2dd5b..556252574d17 100644 --- a/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c +++ b/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c @@ -374,6 +374,12 @@ limTearDownLinkWithAp(tpAniSirGlobal pMac, tANI_U8 sessionId, tSirMacReasonCodes { tLimMlmDeauthInd mlmDeauthInd; + if (pStaDs->mlmStaContext.disassocReason == eSIR_MAC_DEAUTH_LEAVING_BSS_REASON || + pStaDs->mlmStaContext.cleanupTrigger == eLIM_HOST_DEAUTH) { + limLog(pMac, LOGE, + FL("Host already issued deauth, do nothing.\n")); + return; + } #ifdef FEATURE_WLAN_TDLS /* Delete all TDLS peers connected before leaving BSS*/ limDeleteTDLSPeers(pMac, psessionEntry); -- cgit v1.2.3