summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2009-06-30 15:24:45 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-06-30 15:24:45 -0700
commit2bda5b733bb12854760750c08138db95e77aea0c (patch)
tree7b8dc8cad5024e3830f94240d339521130c8763d
parent8ba6b02ecfa5b03bbf2807e8262bb1253a026493 (diff)
Don't try to use bogus bridge data
If, for whatever reason, we weren't able to read bridge data (therefore leaving bridge.pci or bridge.pcmcia empty), we shouldn't try to look at the bus data inside the pci/pcmcia struct.
-rw-r--r--src/common_bridge.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common_bridge.c b/src/common_bridge.c
index 2480ba8..7f26bdc 100644
--- a/src/common_bridge.c
+++ b/src/common_bridge.c
@@ -270,6 +270,10 @@ pci_device_get_bridge_buses(struct pci_device * dev, int *primary_bus,
return ENODEV;
}
+ if (!priv->bridge.pci) {
+ return ENODEV;
+ }
+
switch ((dev->device_class >> 8) & 0x0ff) {
case 0x00:
/* What to do for host bridges? I'm pretty sure this isn't right.