patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] common/iavf: fix arq resource leak
@ 2021-09-10  3:12 Qiming Chen
  2021-09-10  3:29 ` Wang, Haiyue
  2021-09-27  7:12 ` [dpdk-stable] [dpdk-dev] " Zhang, Qi Z
  0 siblings, 2 replies; 6+ messages in thread
From: Qiming Chen @ 2021-09-10  3:12 UTC (permalink / raw)
  To: dev; +Cc: beilei.xing, jingjing.wu, Qiming Chen, stable

In the iavf_init_arq function, if an exception occurs in the
iavf_config_arq_regs function, and the previously applied arq bufs
resource is released. This patch maintains the same modification
as the iavf_init_asq function to roll back resources.

Fixes: 87aca6d8d8a4 ("net/iavf/base: fix command buffer memory leak")
Cc: stable@dpdk.org

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
 drivers/common/iavf/iavf_adminq.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/common/iavf/iavf_adminq.c b/drivers/common/iavf/iavf_adminq.c
index 0bf5af0cbe..9c36e8908e 100644
--- a/drivers/common/iavf/iavf_adminq.c
+++ b/drivers/common/iavf/iavf_adminq.c
@@ -417,7 +417,7 @@ enum iavf_status iavf_init_arq(struct iavf_hw *hw)
 	/* initialize base registers */
 	ret_code = iavf_config_arq_regs(hw);
 	if (ret_code != IAVF_SUCCESS)
-		goto init_adminq_free_rings;
+		goto init_config_regs;
 
 	/* success! */
 	hw->aq.arq.count = hw->aq.num_arq_entries;
@@ -425,6 +425,10 @@ enum iavf_status iavf_init_arq(struct iavf_hw *hw)
 
 init_adminq_free_rings:
 	iavf_free_adminq_arq(hw);
+	return ret_code;
+
+init_config_regs:
+	iavf_free_arq_bufs(hw);
 
 init_adminq_exit:
 	return ret_code;
-- 
2.30.1.windows.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-27  7:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10  3:12 [dpdk-stable] [PATCH] common/iavf: fix arq resource leak Qiming Chen
2021-09-10  3:29 ` Wang, Haiyue
2021-09-10  6:26   ` Qiming Chen
2021-09-10  6:35     ` Wang, Haiyue
2021-09-10  7:07       ` Qiming Chen
2021-09-27  7:12 ` [dpdk-stable] [dpdk-dev] " Zhang, Qi Z

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git