From: Kishore Padmanabha Date: Fri, 17 Jul 2020 14:14:47 +0000 (+0530) Subject: net/bnxt: fix null pointer dereference X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=292611672bf0c8e9c0726b1c183111dddb7fbb1b;p=dpdk.git net/bnxt: fix null pointer dereference Avoid dereferencing a null pointer. Fixes: 313ac35ac701 ("net/bnxt: support ULP session manager init") Cc: stable@dpdk.org Signed-off-by: Kishore Padmanabha Signed-off-by: Somnath Kotur Reviewed-by: Mike Baucom --- diff --git a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c index b2c8c349c9..4df850f226 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c @@ -120,9 +120,11 @@ gfid_not_required: return 0; mem_error: - rte_free(mark_tbl->gfid_tbl); - rte_free(mark_tbl->lfid_tbl); - rte_free(mark_tbl); + if (mark_tbl) { + rte_free(mark_tbl->gfid_tbl); + rte_free(mark_tbl->lfid_tbl); + rte_free(mark_tbl); + } BNXT_TF_DBG(DEBUG, "Failed to allocate memory for mark mgr\n"); return -ENOMEM; }