From 988fd105c59b9d110fb6fa21bdb0db0bae1d8a05 Mon Sep 17 00:00:00 2001 From: Sachin Ahuja Date: Thu, 15 Sep 2016 17:16:25 +0530 Subject: [PATCH] qcacld-3.0: Abort Scan during IBSS stop adapter qcacld-2.0 to qcacld-3.0 propagation After interface down, kernel frees the ongoing scan request memory and call cfg80211_scan_done. Now, during IBSS change iface, stop adapter is called which does not abort the scan. Once the ongoing scan is done, HDD calls the cfg80211_scan_done for which kernel has already freed scan req memory and this leads to crash. Abort the scan during stop adapter for IBSS case also. Change-Id: Ie53576399926cc3a07e6f66c0f3997b6617f9f04 CRs-Fixed: 1047004 --- core/hdd/src/wlan_hdd_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index e89eba40cb63..357114a45e10 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3419,9 +3419,11 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, union iwreq_data wrqu; tSirUpdateIE updateIE; unsigned long rc; + hdd_scaninfo_t *scan_info = NULL; ENTER(); + scan_info = &adapter->scan_info; hdd_notice("Disabling queues"); wlan_hdd_netif_queue_control(adapter, WLAN_NETIF_TX_DISABLE_N_CARRIER, WLAN_CONTROL_PATH); @@ -3474,7 +3476,8 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN); wireless_send_event(adapter->dev, SIOCGIWAP, &wrqu, NULL); - } else { + } + if (scan_info != NULL && scan_info->mScanPending) { wlan_hdd_scan_abort(adapter); } hdd_lro_disable(hdd_ctx, adapter);