net/bnxt: fix a potential null pointer dereference
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 24 Oct 2017 21:19:50 +0000 (16:19 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 26 Oct 2017 00:33:01 +0000 (02:33 +0200)
Coverity issue: 158634
Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ring.c

index 9d0ae27..583c825 100644 (file)
@@ -323,8 +323,10 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
 
                ring = rxr->ag_ring_struct;
                /* Agg ring */
-               if (ring == NULL)
+               if (ring == NULL) {
                        RTE_LOG(ERR, PMD, "Alloc AGG Ring is NULL!\n");
+                       goto err_out;
+               }
 
                rc = bnxt_hwrm_ring_alloc(bp, ring,
                                HWRM_RING_ALLOC_INPUT_RING_TYPE_RX,