From: Ajit Khaparde Date: Tue, 24 Oct 2017 21:19:49 +0000 (-0500) Subject: net/bnxt: fix a potential null pointer dereference X-Git-Tag: spdx-start~1099 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8ec40353d4b1aacb9158755f3e82a8a9ee7df59c;p=dpdk.git net/bnxt: fix a potential null pointer dereference Coverity issue: 195046 Fixes: f7ecea911ec5 ("net/bnxt: fix interrupt handler") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c index 79a119623a..49436cfd9c 100644 --- a/drivers/net/bnxt/bnxt_irq.c +++ b/drivers/net/bnxt/bnxt_irq.c @@ -50,10 +50,14 @@ static void bnxt_int_handler(void *param) struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param; struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; struct bnxt_cp_ring_info *cpr = bp->def_cp_ring; - uint32_t raw_cons = cpr->cp_raw_cons; - uint32_t cons; struct cmpl_base *cmp; + uint32_t raw_cons; + uint32_t cons; + + if (cpr == NULL) + return; + raw_cons = cpr->cp_raw_cons; while (1) { if (!cpr || !cpr->cp_ring_struct) return;