From: gfree.wind@vip.163.com
To: dev@dpdk.org
Cc: Gao Feng <davidfgao@tencent.com>
Subject: [dpdk-dev] [PATCH] eal: fix memleak on mp request error handler
Date: Wed, 5 Dec 2018 10:50:25 +0800 [thread overview]
Message-ID: <1543978226-23480-1-git-send-email-gfree.wind@vip.163.com> (raw)
From: Gao Feng <davidfgao@tencent.com>
When rte_eal_alarm_set failed, need to free the bundle mem in the
error handler of handle_primary_request and handle_secondary_request.
Signed-off-by: Gao Feng <davidfgao@tencent.com>
---
lib/librte_eal/common/hotplug_mp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/librte_eal/common/hotplug_mp.c b/lib/librte_eal/common/hotplug_mp.c
index 070e2e0..9d610a8 100644
--- a/lib/librte_eal/common/hotplug_mp.c
+++ b/lib/librte_eal/common/hotplug_mp.c
@@ -208,6 +208,8 @@ static int cmp_dev_name(const struct rte_device *dev, const void *_name)
ret = rte_eal_alarm_set(1, __handle_secondary_request, bundle);
if (ret != 0) {
RTE_LOG(ERR, EAL, "failed to add mp task\n");
+ free(bundle->peer);
+ free(bundle);
return send_response_to_secondary(req, ret, peer);
}
return 0;
@@ -332,6 +334,8 @@ static void __handle_primary_request(void *param)
*/
ret = rte_eal_alarm_set(1, __handle_primary_request, bundle);
if (ret != 0) {
+ free(bundle->peer);
+ free(bundle);
resp->result = ret;
ret = rte_mp_reply(&mp_resp, peer);
if (ret != 0) {
--
1.8.3.1
next reply other threads:[~2018-12-05 2:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 2:50 gfree.wind [this message]
2018-12-05 2:50 ` [dpdk-dev] [PATCH] devtools: fix symbol check when adding experimental section gfree.wind
2018-12-05 3:46 ` Gao Feng
2018-12-10 16:38 ` [dpdk-dev] [PATCH] eal: fix memleak on mp request error handler Burakov, Anatoly
2018-12-19 22:03 ` Thomas Monjalon
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=1543978226-23480-1-git-send-email-gfree.wind@vip.163.com \
--to=gfree.wind@vip.163.com \
--cc=davidfgao@tencent.com \
--cc=dev@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).