eal: fix memory leak on multi-process hotplug rollback
authorDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Wed, 31 Oct 2018 13:16:53 +0000 (14:16 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 1 Nov 2018 23:05:49 +0000 (00:05 +0100)
Fixes: 244d5130719c ("eal: enable hotplug on multi-process")

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
lib/librte_eal/common/hotplug_mp.c

index b68e4ca..7c9fcc4 100644 (file)
@@ -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;