浏览代码

qcacmn: Validate nbuf in dp trace function

This reverts commit Idb59f83edc09f9be8bf0bd231b8eb6ff28f37fd4.

nbuf was set to NULL and then deferenced.

To address the issue validate nbuf before processing in dp trace function.

Change-Id: I464c0dea36c0288c4bb01d6fba5255169d7ec255
CRs-Fixed: 2220892
jitiphil 7 年之前
父节点
当前提交
e5515b01bf
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      qdf/linux/src/qdf_trace.c

+ 4 - 6
qdf/linux/src/qdf_trace.c

@@ -1196,12 +1196,10 @@ static bool qdf_dp_enable_check(qdf_nbuf_t nbuf, enum QDF_DP_TRACE_ID code,
 	if (qdf_dp_trace_enable_track(code) == false)
 		return false;
 
-	if (!nbuf)
-		return false;
-
-	if ((QDF_NBUF_CB_TX_PACKET_TRACK(nbuf) != QDF_NBUF_TX_PKT_DATA_TRACK) ||
-	    ((dir == QDF_TX) && (QDF_NBUF_CB_TX_DP_TRACE(nbuf) == 0)) ||
-	    ((dir == QDF_RX) && (QDF_NBUF_CB_RX_DP_TRACE(nbuf) == 0)))
+	if ((nbuf) && ((QDF_NBUF_CB_TX_PACKET_TRACK(nbuf) !=
+		 QDF_NBUF_TX_PKT_DATA_TRACK) ||
+		 ((dir == QDF_TX) && (QDF_NBUF_CB_TX_DP_TRACE(nbuf) == 0)) ||
+		 ((dir == QDF_RX) && (QDF_NBUF_CB_RX_DP_TRACE(nbuf) == 0))))
 		return false;
 
 	return true;