From: Gaetan Rivet Date: Wed, 26 Jul 2017 11:52:22 +0000 (+0200) Subject: dev: fix attach proceeding with vdev on PCI success X-Git-Tag: spdx-start~2336 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1c35f666df0786541cd2c83fbad332c1af2a78e7;p=dpdk.git dev: fix attach proceeding with vdev on PCI success When rte_eal_hotplug_add() successfully probes a PCI device, the return value is zero. The check afterward only returns on error different from -EINVAL. It should return also on success, as there is no need to attempt probing the device with vdev. Fixes: 0bba9e605048 ("eal: use new hotplug API in attach") Cc: stable@dpdk.org Signed-off-by: Gaetan Rivet --- diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index e10b9fd850..d74f978f3b 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -74,7 +74,7 @@ int rte_eal_dev_attach(const char *name, const char *devargs) } ret = rte_eal_hotplug_add("pci", name, devargs); - if (ret && ret != -EINVAL) + if (ret != -EINVAL) return ret; /*