If rte_eal_devargs_parse fails, the rte_devargs has not yet been inserted
in the global list. When jumping to err_devarg, the removal fails and it
is not properly freed.
Free the allocated rte_devargs if its removal failed.
Coverity issue: 158658
Fixes:
7e8b26650146 ("eal: fix hotplug add / remove")
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
return 0;
err_devarg:
- rte_eal_devargs_remove(busname, devname);
+ if (rte_eal_devargs_remove(busname, devname)) {
+ free(da->args);
+ free(da);
+ }
err_name:
free(name);
return ret;