Parcourir la source

qcacmn: Fix pointer dereference before null check

vdev getting dereferenced before null check. Fixed the same

Change-Id: If2b701fe8e59a67352aba4d37d4cecee1067c30b
Balamurugan Mahalingam il y a 6 ans
Parent
commit
db12181289
1 fichiers modifiés avec 6 ajouts et 6 suppressions
  1. 6 6
      dp/wifi3.0/dp_tx.c

+ 6 - 6
dp/wifi3.0/dp_tx.c

@@ -2859,6 +2859,12 @@ static inline void dp_tx_comp_process_tx_status(struct dp_tx_desc_s *tx_desc,
 	struct ether_header *eh =
 		(struct ether_header *)qdf_nbuf_data(tx_desc->nbuf);
 
+	if (!vdev) {
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
+				"invalid vdev");
+		goto out;
+	}
+
 	hal_tx_comp_get_status(&tx_desc->comp, &ts, vdev->pdev->soc->hal_soc);
 
 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
@@ -2890,12 +2896,6 @@ static inline void dp_tx_comp_process_tx_status(struct dp_tx_desc_s *tx_desc,
 				ts.ppdu_id, ts.transmit_cnt, ts.tid,
 				ts.peer_id);
 
-	if (!vdev) {
-		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
-				"invalid vdev");
-		goto out;
-	}
-
 	soc = vdev->pdev->soc;
 
 	/* Update SoC level stats */