From 001cfaf94af2e06aac92739e347e9d703f6f91d9 Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Wed, 28 Feb 2018 11:30:46 +0530 Subject: [PATCH] qcacld-3.0: Extend scan cleanup API to support netdev level cleanup In the present scenario the function wlan_cfg80211_cleanup_scan_queue does the code scan queue cleanup during radio detach, leading to access of freed vdev netdev. Extend cfg80211 scan cleanup API to support netdev level cleanup. The second parameter if NULL cleans up all the queues or only the queue of the specific net dev given. Change-Id: I2a6b350fe5102b2a5d772dd9a075003ccf3b684c CRs-Fixed: 2197309 --- core/hdd/src/wlan_hdd_driver_ops.c | 2 +- core/hdd/src/wlan_hdd_main.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 95ca153359ca..5e5fc1f5e18f 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1487,7 +1487,7 @@ static void wlan_hdd_handle_the_pld_uevent(struct pld_uevent_data *uevent) hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (hdd_ctx != NULL) wlan_cfg80211_cleanup_scan_queue( - hdd_ctx->hdd_pdev); + hdd_ctx->hdd_pdev, NULL); break; default: break; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8047684c510a..9129d9d15862 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -623,7 +623,7 @@ static int __hdd_netdev_notifier_call(struct notifier_block *nb, * flag after which driver does not send the cfg80211_scan_done. * Ensure to cleanup the scan queue in NETDEV_GOING_DOWN */ - wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev); + wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev, dev); break; default: @@ -6462,7 +6462,7 @@ static void hdd_wlan_exit(struct hdd_context *hdd_ctx) */ hdd_set_idle_ps_config(hdd_ctx, false); /* clear the scan queue in all the scenarios */ - wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev); + wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev, NULL); if (driver_status != DRIVER_MODULES_CLOSED) { hdd_unregister_wext_all_adapters(hdd_ctx); @@ -12144,7 +12144,7 @@ static void hdd_stop_present_mode(struct hdd_context *hdd_ctx, case QDF_GLOBAL_MISSION_MODE: case QDF_GLOBAL_FTM_MODE: hdd_abort_mac_scan_all_adapters(hdd_ctx); - wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev); + wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev, NULL); hdd_stop_all_adapters(hdd_ctx); break;