diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 04772eeef83a..0357aa4d3e72 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4642,6 +4642,8 @@ QDF_STATUS hdd_start_all_adapters(hdd_context_t *hdd_ctx) hdd_wmm_init(adapter); + adapter->scan_info.mScanPending = false; + switch (adapter->device_mode) { case QDF_STA_MODE: case QDF_P2P_CLIENT_MODE: @@ -4653,7 +4655,6 @@ QDF_STATUS hdd_start_all_adapters(hdd_context_t *hdd_ctx) hdd_init_station_mode(adapter); /* Open the gates for HDD to receive Wext commands */ adapter->isLinkUpSvcNeeded = false; - adapter->scan_info.mScanPending = false; /* Indicate disconnect event to supplicant * if associated previously diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index aaeccef2da3f..6fef0b4aa07f 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -505,19 +505,16 @@ static QDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle, uint32_t size = 0; ret = wlan_hdd_validate_context(hddctx); - if (0 != ret) + if (ret) { + hdd_err("Invalid hdd_ctx; Drop results for scanId %d", scanId); return QDF_STATUS_E_INVAL; + } hdd_debug("called with hal = %p, pContext = %p, ID = %d, status = %d", halHandle, pContext, (int)scanId, (int)status); pScanInfo->mScanPendingCounter = 0; - if (pScanInfo->mScanPending != true) { - QDF_ASSERT(pScanInfo->mScanPending); - goto allow_suspend; - } - if (QDF_STATUS_SUCCESS != wlan_hdd_scan_request_dequeue(hddctx, scanId, &req, &source, &scan_time)) {