summaryrefslogtreecommitdiff
path: root/drivers/net/bnxt/bnxt_rxr.c
diff options
context:
space:
mode:
authorAjit Khaparde <ajit.khaparde@broadcom.com>2017-10-24 16:19:51 -0500
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-26 02:33:01 +0200
commit60fff858ad2db8c607501b6dd8e3f190a3793913 (patch)
treead5445411a075efda58d2e29ff61af78e29df366 /drivers/net/bnxt/bnxt_rxr.c
parentfaabf471da1dcde474ed84b7e311388962d86925 (diff)
downloaddpdk-next-eventdev-60fff858ad2db8c607501b6dd8e3f190a3793913.zip
dpdk-next-eventdev-60fff858ad2db8c607501b6dd8e3f190a3793913.tar.gz
dpdk-next-eventdev-60fff858ad2db8c607501b6dd8e3f190a3793913.tar.xz
net/bnxt: fix a pointer deref before null check
Coverity issue: 158634 Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Diffstat (limited to 'drivers/net/bnxt/bnxt_rxr.c')
-rw-r--r--drivers/net/bnxt/bnxt_rxr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index d9621e5..d68d26f 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -437,11 +437,11 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
cons = rxcmp->opaque;
mbuf = bnxt_consume_rx_buf(rxr, cons);
- rte_prefetch0(mbuf);
-
if (mbuf == NULL)
return -EBUSY;
+ rte_prefetch0(mbuf);
+
mbuf->nb_segs = 1;
mbuf->next = NULL;
mbuf->pkt_len = rxcmp->len;