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 40CBCA0C4E; Sat, 21 Aug 2021 08:32:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A4F4440687; Sat, 21 Aug 2021 08:32:03 +0200 (CEST) Received: from mail-m971.mail.163.com (mail-m971.mail.163.com [123.126.97.1]) by mails.dpdk.org (Postfix) with ESMTP id 04C8D4003E; Sat, 21 Aug 2021 08:31:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=rqa1/ AB7p/wPbB80n0ATejlaLYYGPUR7v8cuBL7iHV0=; b=VYup9TNQZUgq68GnbRcUY qAn1Nq7U94WESLO6wt030ayp/wHXyDV6DvZFPi0tyaFgq1H4wbsCFUp7X3K4qn4H 1nC22rjUroYVZzHJbojcdu8ADOe3gHu3AVnQZMbeG9Kxrw1gPJes54YVIk/iHeU9 h6cYzbNOd65ipx2UCzJhl4= Received: from localhost.localdomain (unknown [124.160.213.137]) by smtp1 (Coremail) with SMTP id GdxpCgCHlLXVnSBhvLIMOg--.7052S2; Sat, 21 Aug 2021 14:31:52 +0800 (CST) From: chenqiming_huawei@163.com To: dev@dpdk.org Cc: beilei.xing@intel.com, Qiming Chen , stable@dpdk.org Date: Sat, 21 Aug 2021 14:30:08 +0800 Message-Id: <20210821063008.4504-1-chenqiming_huawei@163.com> X-Mailer: git-send-email 2.30.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: GdxpCgCHlLXVnSBhvLIMOg--.7052S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7KF13Jw47AF4kWF47JFyrWFg_yoW8Gw1fpF 45Cw47AryUXa15u3yDCayfWF1fuay3G3y3KFW3GasY9w4SkFn7t3Z5KF17A3W5ArsYyrs7 tFs0kr18AayUAFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jfHUgUUUUU= X-Originating-IP: [124.160.213.137] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/xtbBURj1oFaD-4F-aAAAsg Subject: [dpdk-dev] [PATCH] net/i40e/base: fix the resource leakage problem 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 Sender: "dev" From: Qiming Chen In the i40e_init_arq function, when the i40e_config_arq_regs function returns from processing failure, the previously applied arq_bufs resource is not released, which leads to leakage. The patch is processed in the same way as the i40e_init_asq function, maintaining a unified coding style. Fixes: 49ea51605be4 ("net/i40e/base: gracefully clean the resources") Cc: stable@dpdk.org Signed-off-by: Qiming Chen --- drivers/net/i40e/base/i40e_adminq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/base/i40e_adminq.c b/drivers/net/i40e/base/i40e_adminq.c index 0da45f03e4..235667d57a 100644 --- a/drivers/net/i40e/base/i40e_adminq.c +++ b/drivers/net/i40e/base/i40e_adminq.c @@ -468,7 +468,7 @@ enum i40e_status_code i40e_init_arq(struct i40e_hw *hw) /* initialize base registers */ ret_code = i40e_config_arq_regs(hw); if (ret_code != I40E_SUCCESS) - goto init_adminq_free_rings; + goto init_config_regs; /* success! */ hw->aq.arq.count = hw->aq.num_arq_entries; @@ -476,6 +476,10 @@ enum i40e_status_code i40e_init_arq(struct i40e_hw *hw) init_adminq_free_rings: i40e_free_adminq_arq(hw); + return ret_code; + +init_config_regs: + i40e_free_arq_bufs(hw); init_adminq_exit: return ret_code; -- 2.30.1.windows.1