From: Qi Zhang Date: Mon, 22 Oct 2018 06:15:16 +0000 (+0800) Subject: eal: fix bus name read for removal in multi-process X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4dc3db031d6bf556b43adca14841d08431d2e1bf;p=dpdk.git 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: 244d5130719c ("eal: enable hotplug on multi-process") Signed-off-by: Qi Zhang Acked-by: Thomas Monjalon --- diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index 8b0844af16..6ac3ee8597 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -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;