Forráskód Böngészése

qcacmn: Fix NULL pointer dereference for 'pdev' pointer

Fix NULL pointer dereference issue observed using static code analysis for 'pdev' pointer.
Problem ID: 380528, 380530

Change-Id: I057062afc8d347247a74d8ae66fc188b69f5ee0f
Viyom Mittal 6 éve
szülő
commit
757853fd60
1 módosított fájl, 1 hozzáadás és 7 törlés
  1. 1 7
      dp/wifi3.0/dp_main.c

+ 1 - 7
dp/wifi3.0/dp_main.c

@@ -5980,14 +5980,11 @@ void dp_aggregate_vdev_stats(struct dp_vdev *vdev,
 	struct dp_peer *peer = NULL;
 	struct dp_soc *soc = NULL;
 
-	if (!vdev)
+	if (!vdev || !vdev->pdev)
 		return;
 
 	soc = vdev->pdev->soc;
 
-	if (!vdev)
-		return;
-
 	qdf_mem_copy(vdev_stats, &vdev->stats, sizeof(vdev->stats));
 
 	qdf_spin_lock_bh(&soc->peer_ref_mutex);
@@ -5996,9 +5993,6 @@ void dp_aggregate_vdev_stats(struct dp_vdev *vdev,
 	qdf_spin_unlock_bh(&soc->peer_ref_mutex);
 
 #if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
-	if (!vdev->pdev)
-		return;
-
 	dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, vdev->pdev->soc,
 			     vdev_stats, vdev->vdev_id,
 			     UPDATE_VDEV_STATS, vdev->pdev->pdev_id);