From 1ca70f07c80bedbcec3bb0aef20287b5d0981fa9 Mon Sep 17 00:00:00 2001 From: "Ruchi, Agrawal" Date: Mon, 19 Mar 2018 13:53:07 +0530 Subject: [PATCH] qcacmn: Resolve KW issues Add NULL check for nbuf_clone after calling qdf_nbuf_clone Change-Id: Ibffff984b0ace3c5ea19fb72f0e56e041eba0b14 CRs-Fixed: 2209137 --- dp/wifi3.0/dp_tx.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index e6ddfd923a16..6681c615b1eb 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/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)); + } } }