Thread (2 messages) 2 messages, 2 authors, 2021-06-07

[dpdk-dev] [PATCH] net/bnxt: do not use possibly NULL pointers

From: Thierry Herbelot <hidden>
Date: 2021-05-24 09:00:49
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Check that pointers are valid before using them.

Fixes: 7bc8e9a227ccb ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Somnath Kotur <redacted>

Signed-off-by: Thierry Herbelot <redacted>
---
 drivers/net/bnxt/bnxt_irq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 8abbadb3d19d..fd8b8fac989a 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -21,11 +21,14 @@ void bnxt_int_handler(void *param)
 {
 	struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
 	struct bnxt *bp = eth_dev->data->dev_private;
-	struct bnxt_cp_ring_info *cpr = bp->async_cp_ring;
+	struct bnxt_cp_ring_info *cpr;
 	struct cmpl_base *cmp;
 	uint32_t raw_cons;
 	uint32_t cons;
 
+	if (bp == NULL)
+		return;
+	cpr = bp->async_cp_ring;
 	if (cpr == NULL)
 		return;
 
-- 
2.29.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help