Selaa lähdekoodia

qcacld-3.0: Fix memory references in wma_remove_peer()

Check for NULL values of peer  and peer_map_addr before dereferencing.
Move the debug print statement before peer is detached and peer object
is freed.

CRs-Fixed: 1115011
Change-Id: I00d547847eed8e24a01178390b9a62be0b9b75d7
Deepak Dhamdhere 8 vuotta sitten
vanhempi
sitoutus
137b54e9f5
1 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. 4 3
      core/wma/src/wma_dev_if.c

+ 4 - 3
core/wma/src/wma_dev_if.c

@@ -1232,6 +1232,10 @@ void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
 						vdev_id);
 
 peer_detach:
+	WMA_LOGE("%s: Remove peer %p with peer_addr %pM vdevid %d peer_count %d",
+		 __func__, peer, bssid, vdev_id,
+		 wma->interfaces[vdev_id].peer_count);
+
 	if (peer) {
 		if (roam_synch_in_progress)
 			cdp_peer_detach_force_delete(soc, peer);
@@ -1240,9 +1244,6 @@ peer_detach:
 	}
 
 	wma->interfaces[vdev_id].peer_count--;
-	WMA_LOGE("%s: Removed peer %p with peer_addr %pM vdevid %d peer_count %d",
-		 __func__, peer, bssid, vdev_id,
-		 wma->interfaces[vdev_id].peer_count);
 #undef PEER_ALL_TID_BITMASK
 }