From 0024313a7557072275700daae4e06d4aedb5c635 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Tue, 24 Jan 2017 16:37:34 +0530 Subject: [PATCH] qcacld-3.0: Check the device status during hdd cleanup of present mode On a change of the mode ( from the current one to the FTM mode ) , the clean up of the adapters are again done though they are already cleaned ( signified by device_status = DRIVER_MODULES_CLOSED ). Hence check for this device_status while to avoid a redundant clean up of the adapters. Change-Id: I2a851b235809db5cd47ec5d738067d1553f83129 CRs-Fixed: 1115243 --- core/hdd/src/wlan_hdd_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 4a7ce0515779..be74285962d0 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9685,12 +9685,18 @@ static enum tQDF_ADAPTER_MODE hdd_get_adpter_mode( static void hdd_cleanup_present_mode(hdd_context_t *hdd_ctx, enum tQDF_GLOBAL_CON_MODE curr_mode) { + int driver_status; + + driver_status = hdd_ctx->driver_status; + switch (curr_mode) { case QDF_GLOBAL_MISSION_MODE: case QDF_GLOBAL_MONITOR_MODE: case QDF_GLOBAL_FTM_MODE: - hdd_abort_mac_scan_all_adapters(hdd_ctx); - hdd_stop_all_adapters(hdd_ctx); + if (driver_status != DRIVER_MODULES_CLOSED) { + hdd_abort_mac_scan_all_adapters(hdd_ctx); + hdd_stop_all_adapters(hdd_ctx); + } hdd_deinit_all_adapters(hdd_ctx, false); hdd_close_all_adapters(hdd_ctx, false); break;