From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 11080A053B; Fri, 17 Jul 2020 16:21:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 35E971C114; Fri, 17 Jul 2020 16:20:21 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 34BCE2C38 for ; Fri, 17 Jul 2020 16:20:09 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id B68AB299C76; Fri, 17 Jul 2020 07:20:08 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com B68AB299C76 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1594995608; bh=iIIQHaoz4dvgkngTRxCcSekY7mOrHj1lhvqSt93jrfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RhoXbZJdGc567pV31sufEgL2VXG8+kY9gUeAERaU6839flKymjhmMKwBjuf/sWd7x YLBsLwGvRM9n7rvBmRMb/smEWglf6w4CwFJu6yuGkwvAzpi4A+HRJ6DlyaDVDaB6jV Pg9ieir0plOyznZLmyVFXTT5HSj1sLY3Rmw+8wjI= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 17 Jul 2020 19:44:47 +0530 Message-Id: <20200717141451.11705-11-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20200717141451.11705-1-somnath.kotur@broadcom.com> References: <20200717094935.9337-1-somnath.kotur@broadcom.com> <20200717141451.11705-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 10/14] net/bnxt: fix dereference of a null pointer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kishore Padmanabha Avoid dereferencing a null pointer. Fixes: 313ac35ac701 ("net/bnxt: support ULP session manager init") Signed-off-by: Kishore Padmanabha Reviewed-by: Michael Baucom Signed-off-by: Somnath Kotur --- drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c index b2c8c34..4df850f 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 @@ ulp_mark_db_init(struct bnxt_ulp_context *ctxt) 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; } -- 2.7.4