Parcourir la source

qcacld-3.0: Add ndp_ctx NULL check in error scenario

Add ndp_ctx NULL check in error scenario before
dereferencing it.

Propagation from qcacld-2.0 to qcacld-3.0.

Change-Id: I7a6aa92351e0140b78c9d7b95f2a6cca45f8e387
CRs-Fixed: 1044060
Govind Singh il y a 8 ans
Parent
commit
b84759415b
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      core/hdd/src/wlan_hdd_nan_datapath.c

+ 5 - 0
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -1594,6 +1594,11 @@ static void hdd_ndp_end_ind_handler(hdd_adapter_t *adapter,
 			continue;
 		}
 		ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(ndi_adapter);
+		if (!ndp_ctx) {
+			hdd_err("ndp_ctx is NULL for vdev id: %d",
+				end_ind->ndp_map[i].vdev_id);
+			continue;
+		}
 		idx = hdd_get_peer_idx(sta_ctx,
 				&end_ind->ndp_map[i].peer_ndi_mac_addr);
 		if (idx == INVALID_PEER_IDX) {