summaryrefslogtreecommitdiff
path: root/com32/modules/pcitest.c
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-23 10:15:11 +0100
commit83c407350cecf2e21ddead2c872acf720e719af3 (patch)
tree74968854e39c2c608aaa5fdb739b4c9527859dc6 /com32/modules/pcitest.c
parenta06ecb70edf1416701c405513f13f3505a999482 (diff)
downloadsyslinux-83c407350cecf2e21ddead2c872acf720e719af3.tar.gz
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)
Diffstat (limited to 'com32/modules/pcitest.c')
-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;
}