From 9dc8cd6ef7e3c4a045e0b965a9f58499cedfde25 Mon Sep 17 00:00:00 2001 From: Intel Date: Tue, 23 Jul 2013 00:00:00 +0200 Subject: [PATCH] pci: check driver probe return code Signed-off-by: Intel --- lib/librte_eal/common/eal_common_pci.c | 8 +++++++- lib/librte_eal/linuxapp/eal/eal_pci.c | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index bf2a4143ac..97b1a5f869 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -115,10 +115,16 @@ static int pci_probe_all_drivers(struct rte_pci_device *dev) { struct rte_pci_driver *dr = NULL; + int rc; dev->blacklisted = !!is_blacklisted(dev); TAILQ_FOREACH(dr, &driver_list, next) { - if (rte_eal_pci_probe_one_driver(dr, dev)) + rc = rte_eal_pci_probe_one_driver(dr, dev); + if (rc < 0) + /* negative value is an error */ + break; + if (rc > 0) + /* positive value means driver not found */ continue; /* initialize subsequent driver instances for this device */ if ((dr->drv_flags & RTE_PCI_DRV_MULTIPLE) && diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 063a070db9..5c7f814026 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -978,7 +978,8 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d /* call the driver devinit() function */ return dr->devinit(dr, dev); } - return -1; + /* return positive value if driver is not found */ + return 1; } /* Init the PCI EAL subsystem */ -- 2.20.1