From 2c43b439e50df5e1ebf8f97c1e600825d9601ec9 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Wed, 17 Jul 2019 16:11:26 +0530 Subject: [PATCH] net/bnxt: fix crash on probe failure Fixed couple of possible segfaults due to NULL pointer dereference in case of probe failure. Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_irq.c | 3 +++ drivers/net/bnxt/bnxt_vnic.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c index 0bb3eb4faf..61f7498a5f 100644 --- a/drivers/net/bnxt/bnxt_irq.c +++ b/drivers/net/bnxt/bnxt_irq.c @@ -52,6 +52,9 @@ void bnxt_free_int(struct bnxt *bp) { struct bnxt_irq *irq; + if (bp->irq_tbl == NULL) + return; + irq = bp->irq_tbl; if (irq) { if (irq->requested) { diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index 262cfc18d2..20e5bf2d1e 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -89,6 +89,9 @@ void bnxt_free_vnic_attributes(struct bnxt *bp) struct bnxt_vnic_info *vnic; unsigned int i; + if (bp->vnic_info == NULL) + return; + for (i = 0; i < bp->max_vnics; i++) { vnic = &bp->vnic_info[i]; if (vnic->rss_table) { -- 2.20.1