From: Qiming Chen <chenqiming_huawei@163.com>
To: dev@dpdk.org
Cc: beilei.xing@intel.com, jingjing.wu@intel.com,
Qiming Chen <chenqiming_huawei@163.com>,
stable@dpdk.org
Subject: [dpdk-dev] [PATCH] common/iavf: fix arq resource leak
Date: Fri, 10 Sep 2021 11:12:49 +0800 [thread overview]
Message-ID: <20210910031249.11534-1-chenqiming_huawei@163.com> (raw)
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
next reply other threads:[~2021-09-10 3:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 3:12 Qiming Chen [this message]
2021-09-10 3:29 ` [dpdk-dev] [dpdk-stable] " 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-dev] " Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210910031249.11534-1-chenqiming_huawei@163.com \
--to=chenqiming_huawei@163.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).