summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanumanth Reddy Pothula <c_hpothu@codeaurora.org>2017-02-10 19:32:35 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-02-13 16:19:47 -0800
commita3148e6ca8df0a76e98c69869f2a277db877034c (patch)
treeff69ea332a28ea6d41715192e2a8fd034fa61603
parentd13fab753b547b7e2051fb4453bd9478f61e2911 (diff)
qcacld-3.0: Don't process stop_adapter twice
During driver unload, stop_adapter is called for all interfaces without checking DEVICE_IFACE_OPENED flag value. This may lead stop_adapter to be called twice, if interface down is done before driver unload. To mitigate this issue, process stop_adapter only when DEVICE_IFACE_OPENED flag is set. Change-Id: Ibbcc138ae7dd4ac9153043c7f61363d6ecb8daca CRs-Fixed: 2003411
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c5
-rw-r--r--core/hdd/src/wlan_hdd_main.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 7d27f5d51234..19c99cbd4fcd 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -311,11 +311,6 @@ static int __hdd_hostapd_stop(struct net_device *dev)
return -ENODEV;
}
- if (!test_bit(DEVICE_IFACE_OPENED, &adapter->event_flags)) {
- hdd_info("iface is not in open state, flags: %lu",
- adapter->event_flags);
- return 0;
- }
if (!sap_ctx) {
hdd_err("invalid sap ctx : %p", sap_ctx);
return -ENODEV;
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 02e77cc87a7e..ad3fe67d5c59 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -3606,6 +3606,12 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
ENTER();
+ if (!test_bit(DEVICE_IFACE_OPENED, &adapter->event_flags)) {
+ hdd_info("interface %d is not up %lu",
+ adapter->device_mode, adapter->event_flags);
+ return -ENODEV;
+ }
+
scan_info = &adapter->scan_info;
hdd_notice("Disabling queues");
wlan_hdd_netif_queue_control(adapter, WLAN_NETIF_TX_DISABLE_N_CARRIER,