From 3f44ec48c733f7d7607877164c9aa0305de9cecd Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Tue, 20 Jul 2021 21:51:58 +0530 Subject: [PATCH] net/bnxt: fix null dereference in interrupt handler Coverity reports that pointer "cpr->cp_ring_struct" may be dereferenced with null value. This patch fixes this. Coverity issue: 372063 Fixes: 5ed30db87fa8 ("net/bnxt: fix missing barriers in completion handling") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Lance Richardson --- drivers/net/bnxt/bnxt_irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c index ebdac8385d..122a1f9908 100644 --- a/drivers/net/bnxt/bnxt_irq.c +++ b/drivers/net/bnxt/bnxt_irq.c @@ -33,7 +33,6 @@ void bnxt_int_handler(void *param) return; raw_cons = cpr->cp_raw_cons; - cp_ring_size = cpr->cp_ring_struct->ring_size; pthread_mutex_lock(&bp->def_cp_lock); while (1) { if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.doorbell) { @@ -46,6 +45,7 @@ void bnxt_int_handler(void *param) return; } + cp_ring_size = cpr->cp_ring_struct->ring_size; cons = RING_CMP(cpr->cp_ring_struct, raw_cons); cmp = &cpr->cp_desc_ring[cons]; -- 2.39.5