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 04328A034E; Tue, 22 Feb 2022 19:19:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F125C4116E; Tue, 22 Feb 2022 19:18:49 +0100 (CET) Received: from out203-205-221-191.mail.qq.com (out203-205-221-191.mail.qq.com [203.205.221.191]) by mails.dpdk.org (Postfix) with ESMTP id 289FE4116D for ; Tue, 22 Feb 2022 19:18:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1645553926; bh=jMo7bxp26KKCY8jhxVwS9kR377l9jqJbp7bGJGORCgk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aKLiV/Ux87hnpSk3cFV7lZa8/tkSD5V9w0ZfnCmOuO3tomwPYzAT6aEWpcjHpf9Jp FXSpBSt5IUOQITEjswyPc2sBth/SCOqYh9Mb/qQ0tnkH+/GIc20OWg1T8Pil/eHiGk ClNsBXPGw/bLA0jhjV2H59UUc27yqz/IZr5ka2GE= Received: from localhost.localdomain ([111.193.130.237]) by newxmesmtplogicsvrszc6.qq.com (NewEsmtp) with SMTP id 49223207; Wed, 23 Feb 2022 02:18:18 +0800 X-QQ-mid: xmsmtpt1645553922to2fenu88 Message-ID: X-QQ-XMAILINFO: OE2SNMSfMbmOQgxrkAJK7JbaZ4UGc0rBdMVPb4CefpsHrHtzCCgqMaxDf/pkP3 Dr1ymtnuupywwtPUnitphuC83CY5e9hcF2UUkXWZc5k03xAnQwvh3TlJUusrdPiuxM1vkX0TcNv/ 7VvOsRNWytCH1jwRCQR7AWUaawuHiA2n/lw5gfuJzanfWtDpg6eceCJkxUvPQ5oJ/Yg49FwMPPWi qL12k9R/FJPVcrwJks5gC5e43RkaOOH9u7sbQMuTNFVHbevPxOoWESMCWD7QGz9A7sBn0laWMPOA YN9ZtEeVE1IxN73tv4gvi6KzPn/3DA4JUDdzQmcJmL03Sn574JMA3IM4aiYxPf21kc2PJbZU4N8b r08U2AzcDeBNxRZoKpx44Fwg3k2NQKtYUP/XAvgYfxqIjwF/1RCYEZukZCJ5pDFgBBOIoib6IMy9 nLu7m1Rb/qRTDkOoj7gV00BsztJ1PJDrrVtiKyQFkQnIDgyeZjKxjikPxbxOz+4E81qjAvRu4oiF oU15yJChBGZq+caknTTRWXKitl3PLhpglT9kiYeaQLtqd+gscBTD6KbDAVFr2N6s/9MYHjNCzRuz D9UfZ2PSdoQ1Q/e154v51o01Nt+wjYgb2jGb8pdiX44Cvt4Jcs5Yktpf05L73nTGj2r74aRrcPC0 k5Abw9NCzo/tLZ3DFWIQfrwDBB5hj8BfSuODxM2KGFXY5Mt/L7gz5DI2mBMXBC+BxoLS+I5U6zZy /MJgu/Er0sPaMu3lzZMTU+XLeFe1FHA+I1K/e9COabyiXNmizJNeEQAQYjgZYr9+K9W0qJukr8F3 CcNrDgwwIqpR8PFehJpN/oUe50ySXnbdks3TO3TTBz1KB/NW8srT1LRcnZWQWhliSZZpscIqFW9U 3XLXGSeetIaN5i4cVdh2nDMJ/7p5hRqA== From: Weiguo Li To: dev@dpdk.org Cc: adypodoman@gmail.com, xiaoyun.li@intel.com, tianfei.zhang@intel.com, bruce.richardson@intel.com, ivan.malov@oktetlabs.ru, jgrajcia@cisco.com, hkalra@marvell.com, ying.a.wang@intel.com, ting.xu@intel.com, simei.su@intel.com, qiming.yang@intel.com, motih@mellanox.com, shreyansh.jain@nxp.com, skoteshwar@marvell.com, stephen@networkplumber.org, kalesh-anakkur.purayil@broadcom.com, somnath.kotur@broadcom.com, declan.doherty@intel.com, gakhil@marvell.com, nicolas.chautru@intel.com Subject: [PATCH 05/20] net/bnxt: fix a memory leak in error handling Date: Wed, 23 Feb 2022 02:18:03 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 When run goto from this branch, the 'ulp_fc_info' has not set into the context yet, so ulp_fc_mgr_deinit(ctxt) in the error label can not release 'ulp_fc_info' in this case which cause a memory leak. Fixes: 9cf9c8385df7 ("net/bnxt: add ULP flow counter manager") Signed-off-by: Weiguo Li --- drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c index 85c9cbb7f2..b055463ea4 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +++ b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c @@ -86,6 +86,7 @@ ulp_fc_mgr_init(struct bnxt_ulp_context *ctxt) rc = pthread_mutex_init(&ulp_fc_info->fc_lock, NULL); if (rc) { + rte_free(ulp_fc_info); PMD_DRV_LOG(ERR, "Failed to initialize fc mutex\n"); goto error; } -- 2.25.1