DPDK patches and discussions
 help / color / mirror / Atom feed
From: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
To: dev@dpdk.org
Cc: Darek Stojaczyk <dariusz.stojaczyk@intel.com>,
	qi.z.zhang@intel.com, anatoly.burakov@intel.com
Subject: [dpdk-dev] [PATCH v2] eal: fix IPC memleak on device hotplug
Date: Mon, 29 Oct 2018 12:47:18 +0100	[thread overview]
Message-ID: <20181029114718.14143-1-dariusz.stojaczyk@intel.com> (raw)
In-Reply-To: <20181025104619.137205-1-dariusz.stojaczyk@intel.com>

rte_mp_request_sync() says that the caller is responsible
for freeing one of its parameters afterwards. EAL didn't
do that, causing a memory leak.

Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
Cc: qi.z.zhang@intel.com
Cc: anatoly.burakov@intel.com

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
---
 lib/librte_eal/common/hotplug_mp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_eal/common/hotplug_mp.c b/lib/librte_eal/common/hotplug_mp.c
index 84f59d95b..b68e4cabb 100644
--- a/lib/librte_eal/common/hotplug_mp.c
+++ b/lib/librte_eal/common/hotplug_mp.c
@@ -355,6 +355,7 @@ int eal_dev_hotplug_request_to_primary(struct eal_dev_mp_req *req)
 	resp = (struct eal_dev_mp_req *)mp_reply.msgs[0].param;
 	req->result = resp->result;
 
+	free(mp_reply.msgs);
 	return ret;
 }
 
@@ -379,6 +380,7 @@ int eal_dev_hotplug_request_to_secondary(struct eal_dev_mp_req *req)
 
 	if (mp_reply.nb_sent != mp_reply.nb_received) {
 		RTE_LOG(ERR, EAL, "not all secondary reply\n");
+		free(mp_reply.msgs);
 		return -1;
 	}
 
@@ -397,6 +399,7 @@ int eal_dev_hotplug_request_to_secondary(struct eal_dev_mp_req *req)
 		}
 	}
 
+	free(mp_reply.msgs);
 	return 0;
 }
 
-- 
2.17.1

  parent reply	other threads:[~2018-10-29 11:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 10:46 [dpdk-dev] [PATCH] eal: fix rte_mp_request_sync() " Darek Stojaczyk
2018-10-26 14:22 ` Burakov, Anatoly
2018-10-29 12:02   ` Stojaczyk, Dariusz
2018-10-29 14:25     ` Zhang, Qi Z
2018-10-29 11:47 ` Darek Stojaczyk [this message]
2018-10-30 10:15   ` [dpdk-dev] [PATCH v2] eal: fix IPC " Burakov, Anatoly
2018-10-31 17:21     ` 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=20181029114718.14143-1-dariusz.stojaczyk@intel.com \
    --to=dariusz.stojaczyk@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    /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).