diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 586c50f56334..715cf884ee2b 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1107,6 +1107,10 @@ static CDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle, uint32_t scan_time; uint32_t size = 0; + ret = wlan_hdd_validate_context(hddctx); + if (0 != ret) + return CDF_STATUS_E_INVAL; + hddLog(CDF_TRACE_LEVEL_INFO, "%s called with hal = %p, pContext = %p, ID = %d, status = %d", __func__, halHandle, pContext, (int)scanId, (int)status); diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 459724608f9b..b3a1e0e88d19 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -2751,6 +2751,11 @@ void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter) return; } + if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) { + hdd_info("TDLS mode is disabled OR not enabled"); + return; + } + /* free allocated memory at scan time */ wlan_hdd_tdls_free_scan_request(&pHddCtx->tdls_scan_ctxt);