[dpdk-dev] [PATCH] eal: fix memleak on device hotplug rollback

Darek Stojaczyk dariusz.stojaczyk at intel.com
Wed Oct 31 14:16:53 CET 2018


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

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

diff --git a/lib/librte_eal/common/hotplug_mp.c b/lib/librte_eal/common/hotplug_mp.c
index b68e4cabb..7c9fcc46c 100644
--- a/lib/librte_eal/common/hotplug_mp.c
+++ b/lib/librte_eal/common/hotplug_mp.c
@@ -243,7 +243,7 @@ static void __handle_primary_request(void *param)
 		da = calloc(1, sizeof(*da));
 		if (da == NULL) {
 			ret = -ENOMEM;
-			goto quit;
+			break;
 		}
 
 		ret = rte_devargs_parse(da, req->devargs);
@@ -266,6 +266,8 @@ static void __handle_primary_request(void *param)
 
 		ret = local_dev_remove(dev);
 quit:
+		free(da->args);
+		free(da);
 		break;
 	default:
 		ret = -EINVAL;
-- 
2.17.1



More information about the dev mailing list