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
This commit is contained in:
Nitesh Shah 2017-06-09 11:26:44 +05:30 committed by snandini
parent 28b297c547
commit e410b80979

View File

@ -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);