Quellcode durchsuchen

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
Nitesh Shah vor 7 Jahren
Ursprung
Commit
e410b80979
1 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  1. 3 1
      core/hdd/src/wlan_hdd_tdls.c

+ 3 - 1
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);