net/bnxt: fix crash on probe failure
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Wed, 17 Jul 2019 10:41:26 +0000 (16:11 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:35 +0000 (14:31 +0200)
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 <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_irq.c
drivers/net/bnxt/bnxt_vnic.c

index 0bb3eb4..61f7498 100644 (file)
@@ -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) {
index 262cfc1..20e5bf2 100644 (file)
@@ -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) {