summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDarek Stojaczyk <dariusz.stojaczyk@intel.com>2018-10-29 12:47:18 +0100
committerThomas Monjalon <thomas@monjalon.net>2018-10-31 19:16:42 +0100
commit04854a39e6f61a376bf3cc93087dfc15ab31e3be (patch)
tree84721d0a0897f8f073b7e64de9542b54adb8ae03 /lib
parent98372f54ce9b952531680c147252b4e53ed8ea43 (diff)
downloaddpdk-04854a39e6f61a376bf3cc93087dfc15ab31e3be.zip
dpdk-04854a39e6f61a376bf3cc93087dfc15ab31e3be.tar.gz
dpdk-04854a39e6f61a376bf3cc93087dfc15ab31e3be.tar.xz
eal: fix IPC memory leak on device hotplug
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") Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_eal/common/hotplug_mp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/librte_eal/common/hotplug_mp.c b/lib/librte_eal/common/hotplug_mp.c
index 84f59d9..b68e4ca 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;
}