eal: fix bus name read for removal in multi-process

A crash may appear when removing some PCI devices because
dev->devargs is not always initialized. So use dev->bus instead of
dev->devargs->bus when building devargs string to remove a device.

Fixes: 244d513071 ("eal: enable hotplug on multi-process")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
This commit is contained in:
Qi Zhang 2018-10-22 14:15:16 +08:00 committed by Thomas Monjalon
parent 9ffe2f4e18
commit 4dc3db031d

View File

@ -387,7 +387,7 @@ rte_dev_remove(struct rte_device *dev)
return -ENOENT;
}
ret = build_devargs(dev->devargs->bus->name, dev->name, "", &devargs);
ret = build_devargs(dev->bus->name, dev->name, "", &devargs);
if (ret != 0)
return ret;