Parcourir la source

qcacmn: Resolve KW issues

Add NULL check for nbuf_clone after calling
qdf_nbuf_clone

Change-Id: Ibffff984b0ace3c5ea19fb72f0e56e041eba0b14
CRs-Fixed: 2209137
Ruchi, Agrawal il y a 7 ans
Parent
commit
1ca70f07c8
1 fichiers modifiés avec 8 ajouts et 4 suppressions
  1. 8 4
      dp/wifi3.0/dp_tx.c

+ 8 - 4
dp/wifi3.0/dp_tx.c

@@ -971,17 +971,21 @@ static bool dp_cce_classify(struct dp_vdev *vdev, qdf_nbuf_t nbuf)
 		ether_type = *(uint16_t *)(nbuf->data + 2*ETHER_ADDR_LEN +
 				sizeof(*llcHdr));
 		nbuf_clone = qdf_nbuf_clone(nbuf);
-		qdf_nbuf_pull_head(nbuf_clone, sizeof(*llcHdr));
+		if (qdf_unlikely(nbuf_clone)) {
+			qdf_nbuf_pull_head(nbuf_clone, sizeof(*llcHdr));
 
-		if (ether_type == htons(ETHERTYPE_8021Q)) {
-			qdf_nbuf_pull_head(nbuf_clone,
+			if (ether_type == htons(ETHERTYPE_8021Q)) {
+				qdf_nbuf_pull_head(nbuf_clone,
 						sizeof(qdf_net_vlanhdr_t));
+			}
 		}
 	} else {
 		if (ether_type == htons(ETHERTYPE_8021Q)) {
 			nbuf_clone = qdf_nbuf_clone(nbuf);
-			qdf_nbuf_pull_head(nbuf_clone,
+			if (qdf_unlikely(nbuf_clone)) {
+				qdf_nbuf_pull_head(nbuf_clone,
 					sizeof(qdf_net_vlanhdr_t));
+			}
 		}
 	}