From 2d5453431ec712f71a614656b37586b1ab611a55 Mon Sep 17 00:00:00 2001 From: lifeng Date: Fri, 8 Mar 2019 11:15:23 +0800 Subject: [PATCH] qcacld-3.0: Fix race condition between kickout and disconnect qcacld-2.0 to qcacld-3.0 propagation There's race condition between kickout event and disconnect command. It cause disconnect_comp_var is not completed properly. Add check in lim_tear_down_link_with_ap to eliminate the race condition. Change-Id: Iebe98911cc41e8b33f8f403b75c79a75a38ca0a6 CRs-Fixed: 2417753 --- core/mac/src/pe/lim/lim_link_monitoring_algo.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/mac/src/pe/lim/lim_link_monitoring_algo.c b/core/mac/src/pe/lim/lim_link_monitoring_algo.c index 20a73b5905..2ef43d0dc3 100644 --- a/core/mac/src/pe/lim/lim_link_monitoring_algo.c +++ b/core/mac/src/pe/lim/lim_link_monitoring_algo.c @@ -385,6 +385,14 @@ lim_tear_down_link_with_ap(struct mac_context *mac, uint8_t sessionId, if (sta != NULL) { tLimMlmDeauthInd mlmDeauthInd; + if ((sta->mlmStaContext.disassocReason == + eSIR_MAC_DEAUTH_LEAVING_BSS_REASON) || + (sta->mlmStaContext.cleanupTrigger == + eLIM_HOST_DEAUTH)) { + pe_err("Host already issued deauth, do nothing"); + return; + } + #ifdef FEATURE_WLAN_TDLS /* Delete all TDLS peers connected before leaving BSS */ lim_delete_tdls_peers(mac, pe_session);