summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManikandan Mohan <manikand@codeaurora.org>2017-03-02 17:20:20 -0800
committerqcabuildsw <qcabuildsw@localhost>2017-03-03 17:32:25 -0800
commit7b1ea551959b612d7929ee04298eb08319cb889f (patch)
treea3e3666e77467bad639c67e3c9605a04ec93cb58
parenta0d5e928a559fd5014ede5fc34e66ddae58fbf40 (diff)
qcacld-3.0: Fix race condition on SAP close and driver exit
When hostapd close and wlan driver unload are happening in parallel in different context, there could be a race condition in closing adapter SAP context resulting in crash. Update to fix the crash by protecting SAP close functions with lock. Change-Id: I457b765d4932ad2c321fbc7e02f6ab4f289abb10 CRs-fixed: 2014663
-rw-r--r--core/hdd/src/wlan_hdd_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index c3a4102fd208..0963bab10e72 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -3778,7 +3778,6 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
qdf_mem_free(adapter->sessionCtx.ap.beacon);
adapter->sessionCtx.ap.beacon = NULL;
}
- mutex_unlock(&hdd_ctx->sap_lock);
if (true == bCloseSession)
hdd_wait_for_sme_close_sesion(hdd_ctx, adapter);
@@ -3790,6 +3789,7 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
hdd_err("Failed:WLANSAP_close");
adapter->sessionCtx.ap.sapContext = NULL;
+ mutex_unlock(&hdd_ctx->sap_lock);
break;
case QDF_OCB_MODE: