From 4dc3db031d6bf556b43adca14841d08431d2e1bf Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Mon, 22 Oct 2018 14:15:16 +0800 Subject: [PATCH] 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 --- lib/librte_eal/common/eal_common_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.20.1