aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-03-23 10:15:11 +0100
committerErwan Velu <erwan.velu@free.fr>2009-03-26 18:26:35 +0100
commit8d1995dfa8c393cd4c5c88a691594849766ee228 (patch)
tree2d55a7c0e0118c795d68ad28174546a4e9a02f53
parentf2d07ce8e43953ec1eeca162cdac1d86c6e978c9 (diff)
downloadsyslinux.git-8d1995dfa8c393cd4c5c88a691594849766ee228.tar.gz
syslinux.git-8d1995dfa8c393cd4c5c88a691594849766ee228.tar.xz
syslinux.git-8d1995dfa8c393cd4c5c88a691594849766ee228.zip
pci modules: Check for pci_scan() == NULL.
Impact: we don't have to grab more details if pci_scan returns NULL Signed-off-by: Sebastian Herbszt (herbszt@gmx.de)
-rw-r--r--com32/modules/pcitest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/com32/modules/pcitest.c b/com32/modules/pcitest.c
index 00647535..d13c3a6f 100644
--- a/com32/modules/pcitest.c
+++ b/com32/modules/pcitest.c
@@ -102,6 +102,10 @@ int main(int argc, char *argv[])
/* Scanning to detect pci buses and devices */
printf("PCI: Scanning PCI BUS\n");
pci_domain = pci_scan();
+ if (!pci_domain) {
+ printf("PCI: no devices found!\n");
+ return 1;
+ }
struct pci_device *pci_device;
for_each_pci_func(pci_device, pci_domain) {
@@ -140,5 +144,5 @@ int main(int argc, char *argv[])
/* display the pci devices we found */
display_pci_devices(pci_domain);
- return 1;
+ return 0;
}