wlan: Fix for race condition between scan done callback and triggering scan.
After calling cfg80211_scan_done, before mScanPending making to false,we
are receiving scan request and return with EBUSY.
Change-Id: I478b124916bf8b1b53bcba9684025cad1d91dfde
CR-Fixed: 408423
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 6c3cb8c..9f544b8 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -3561,16 +3561,16 @@
req->n_channels = 0;
req->ie = 0;
- /*
- * cfg80211_scan_done informing NL80211 about completion
- * of scanning
- */
- cfg80211_scan_done(req, false);
complete(&pAdapter->abortscan_event_var);
pAdapter->request = NULL;
/* Scan is no longer pending */
pScanInfo->mScanPending = VOS_FALSE;
+ /*
+ * cfg80211_scan_done informing NL80211 about completion
+ * of scanning
+ */
+ cfg80211_scan_done(req, false);
#ifdef WLAN_FEATURE_P2P
/* Flush out scan result after p2p_serach is done */
if(pScanInfo->flushP2pScanResults)