summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiva Mullati <smullati@codeaurora.org>2016-11-25 15:29:59 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2016-11-29 23:17:31 -0800
commitb2af65eeb95fb09ad166d763127afe9d3927e0a2 (patch)
treee812c0595fec1f53b8bd823cbfffbbd8f20d8081
parentf1081e78eff75ca665c662493736b17cb792b46d (diff)
qcacld-2.0: Fix recursive lock of mutex "tdls_lock" on discovery
During tdls implicit discovery, wlan driver is hung inside wlan_hdd_tdls_implicit_send_discovery_request function. This is due to "tdls_lock" mutex being acquired recursively i.e. once directly inside the function and once inside the called function "wlan_hdd_tdls_check_bmps". The fix is to unlock the mutex after wlan_hdd_tdls_check_power_save_prohibited() function and then lock it before tdls timer restart. Change-Id: I2ef1176e3a2429e04d896e034a5b10ae93f8518f CRs-Fixed: 1093662
-rw-r--r--CORE/HDD/src/wlan_hdd_tdls.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c
index fc053af4d052..4c6f6c8a3a9f 100644
--- a/CORE/HDD/src/wlan_hdd_tdls.c
+++ b/CORE/HDD/src/wlan_hdd_tdls.c
@@ -2630,6 +2630,8 @@ void wlan_hdd_tdls_implicit_send_discovery_request(tdlsCtx_t * pHddTdlsCtx)
wlan_hdd_tdls_check_power_save_prohibited(pHddTdlsCtx->pAdapter);
+ mutex_unlock(&pHddCtx->tdls_lock);
+
wlan_hdd_tdls_check_bmps(pHddTdlsCtx->pAdapter);
VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
@@ -2637,6 +2639,8 @@ void wlan_hdd_tdls_implicit_send_discovery_request(tdlsCtx_t * pHddTdlsCtx)
__func__, pHddTdlsCtx->discovery_sent_cnt,
pHddTdlsCtx->threshold_config.tx_period_t - TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE);
+ mutex_lock(&pHddCtx->tdls_lock);
+
wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter,
&pHddTdlsCtx->peerDiscoveryTimeoutTimer,
pHddTdlsCtx->threshold_config.tx_period_t - TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE);