From e410b80979fc6e53d735c90263d9c6db4d38c61e Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Fri, 9 Jun 2017 11:26:44 +0530 Subject: [PATCH] qcacld-3.0: Release mutex properly when TDLS peer not found Mutex is not released properly in the loop when the TDLS peer is not found in the function wlan_hdd_tdls_disable_ offchan_and_teardown_links(), that can cause crash. This change releases the mutex properly in the function wlan_hdd_tdls_disable_offchan_and_teardown_links() when TDLS peer is not found, and going for the next loop. Change-Id: Ia226c71e91e0e5995dd86557e0135508f32d8bef CRs-Fixed: 2058784 --- core/hdd/src/wlan_hdd_tdls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 76157a94130d5..5aae31272c2a1 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -271,8 +271,10 @@ void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx) mutex_lock(&hddctx->tdls_lock); curr_peer = wlan_hdd_tdls_find_all_peer(hddctx, hddctx->tdlsConnInfo[staidx].peerMac.bytes); - if (!curr_peer) + if (!curr_peer) { + mutex_unlock(&hddctx->tdls_lock); continue; + } hdd_notice("indicate TDLS teardown (staId %d)", curr_peer->staId);