From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3B82EA00C2; Tue, 27 Sep 2022 18:00:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0FA742686; Tue, 27 Sep 2022 18:00:48 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (lpdvacalvio01.broadcom.com [192.19.166.228]) by mails.dpdk.org (Postfix) with ESMTP id F3AF340694 for ; Tue, 27 Sep 2022 18:00:46 +0200 (CEST) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 4823CC000D96; Tue, 27 Sep 2022 09:00:45 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 4823CC000D96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1664294446; bh=VKLuUG5ydgPNWKKsHaUHjh47X7MmmFzycAcL5FOAQL4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nUvsaNFMGGPE2zTlzNVk6ZdxE7RURv/El9WvUB2pYDEOuXZfk46YPY4LPmt9H84no CyruTDR3xjmjSo438BFougRC7w4rtl2yNYk15+1Zdcah5V1ii6UIIUeFoZroymEIPo V51eJQKEi2p+Djf5CUizNsUS2x82NDrvsoEeKfqQ= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@xilinx.com, ajit.khaparde@broadcom.com Subject: [dpdk-dev] [PATCH 2/2] net/bnxt: fix freeing of representor info memory Date: Tue, 27 Sep 2022 21:29:02 +0530 Message-Id: <20220927155902.29850-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220927155902.29850-1-kalesh-anakkur.purayil@broadcom.com> References: <20220927155902.29850-1-kalesh-anakkur.purayil@broadcom.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Kalesh AP Driver allocates "bp->rep_info" inside bnxt_init_rep_info() which is invoked from bnxt_rep_port_probe(). But the memory is freed inside bnxt_uninit_resources(), which is wrong. As a result, after error recovery bp->rep_info will be NULL. The memory should have freed inside bnxt_drv_uninit() to maintain symmetry of calls. Fixes: 6dc83230b43b ("net/bnxt: support port representor data path") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 84cf9a3..b033ad7 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1654,6 +1654,7 @@ static void bnxt_drv_uninit(struct bnxt *bp) bnxt_free_link_info(bp); bnxt_free_parent_info(bp); bnxt_uninit_locks(bp); + bnxt_free_rep_info(bp); rte_memzone_free((const struct rte_memzone *)bp->tx_mem_zone); bp->tx_mem_zone = NULL; @@ -5978,7 +5979,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev) bnxt_free_flow_stats_info(bp); bnxt_free_switch_domain(bp); - bnxt_free_rep_info(bp); rte_free(bp->ptp_cfg); bp->ptp_cfg = NULL; return rc; -- 2.10.1