From: Ajit Khaparde Date: Tue, 24 Oct 2017 21:19:50 +0000 (-0500) Subject: net/bnxt: fix a potential null pointer dereference X-Git-Tag: spdx-start~1098 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=faabf471da1dcde474ed84b7e311388962d86925;p=dpdk.git net/bnxt: fix a potential null pointer dereference Coverity issue: 158634 Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c index 9d0ae277e2..583c82569d 100644 --- a/drivers/net/bnxt/bnxt_ring.c +++ b/drivers/net/bnxt/bnxt_ring.c @@ -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,