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 4B837A053D; Fri, 17 Jul 2020 11:56:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 424781C02C; Fri, 17 Jul 2020 11:55:13 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id 4C40F1BFFA for ; Fri, 17 Jul 2020 11:55:05 +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 DF0461BBDAF; Fri, 17 Jul 2020 02:55:04 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com DF0461BBDAF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1594979705; bh=iIIQHaoz4dvgkngTRxCcSekY7mOrHj1lhvqSt93jrfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pelFV+m/RfPXuQDDvo2YN/3/uokg1OYQzhxvH8J38QiOtcN5ren+Q+9kOlYplkg0B W1KTiF9tQAeOeUoI/D9iCsCEHyxosth58b0DUtwLlemUfCdafGD2d5NQ0LyxM5HHWB fRmGVT9Mc/JnmGivwN+YOytL1M2s4HyDuO3VzjWY= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 17 Jul 2020 15:19:31 +0530 Message-Id: <20200717094935.9337-11-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20200717094935.9337-1-somnath.kotur@broadcom.com> References: <20200717094935.9337-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