Discussion:
[dpdk-dev] [PATCH] eal: fix memleak on mp request error handler
g***@vip.163.com
2018-12-05 02:50:25 UTC
Permalink
From: Gao Feng <***@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 <***@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
g***@vip.163.com
2018-12-05 02:50:26 UTC
Permalink
From: David Marchand <***@redhat.com>

The incriminated commit did relax the condition to catch all sections
but dropped the + removal which can trigger false detection of the
special EXPERIMENTAL section when adding symbols and the section in the
same patch.

Fixes: 7281cf520f89 ("devtools: relax rule for identifying symbol section")
Cc: ***@dpdk.org

Signed-off-by: David Marchand <***@redhat.com>
Acked-by: Neil Horman <***@tuxdriver.com>
---
devtools/check-symbol-change.sh | 1 +
1 file changed, 1 insertion(+)

diff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh
index 4b8d9f3..020da7e 100755
--- a/devtools/check-symbol-change.sh
+++ b/devtools/check-symbol-change.sh
@@ -31,6 +31,7 @@ build_map_changes()
# Triggering this rule sets in_sec to 1, which actives the
# symbol rule below
/^.*{/ {
+ gsub("+", "");
if (in_map == 1) {
sec=$(NF-1); in_sec=1;
}
--
2.7.4
Gao Feng
2018-12-05 03:46:58 UTC
Permalink
Sorry for the noise. Please ignore this reply.

It is caused by wrong command.

Best Regards
Feng
Post by g***@vip.163.com
The incriminated commit did relax the condition to catch all sections
but dropped the + removal which can trigger false detection of the
special EXPERIMENTAL section when adding symbols and the section in the
same patch.
Fixes: 7281cf520f89 ("devtools: relax rule for identifying symbol section")
---
devtools/check-symbol-change.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh
index 4b8d9f3..020da7e 100755
--- a/devtools/check-symbol-change.sh
+++ b/devtools/check-symbol-change.sh
@@ -31,6 +31,7 @@ build_map_changes()
# Triggering this rule sets in_sec to 1, which actives the
# symbol rule below
/^.*{/ {
+ gsub("+", "");
if (in_map == 1) {
sec=$(NF-1); in_sec=1;
}
--
2.7
Burakov, Anatoly
2018-12-10 16:38:41 UTC
Permalink
Post by g***@vip.163.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.
---
Acked-by: Anatoly Burakov <***@intel.com>
--
Thanks,
Anatoly
Loading...