summaryrefslogtreecommitdiff
path: root/sys/arch/i386/pci/geodesc.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-12-11 20:57:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-12-11 20:57:41 +0000
commite231741f7089c00bca4d3aa2781dd927a3a39fa7 (patch)
tree5f86783cd27ff2c71d47b1c04e493952cd2e3be2 /sys/arch/i386/pci/geodesc.c
parent97889fe59edb152e2c04893ee1fe4e395a0adefd (diff)
do not bus_space_map devices which are at address 0; ok kettenis
Diffstat (limited to 'sys/arch/i386/pci/geodesc.c')
-rw-r--r--sys/arch/i386/pci/geodesc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/i386/pci/geodesc.c b/sys/arch/i386/pci/geodesc.c
index ee839b67b76..128c5caa0fc 100644
--- a/sys/arch/i386/pci/geodesc.c
+++ b/sys/arch/i386/pci/geodesc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: geodesc.c,v 1.8 2006/10/18 19:09:14 deraadt Exp $ */
+/* $OpenBSD: geodesc.c,v 1.9 2006/12/11 20:57:40 deraadt Exp $ */
/*
* Copyright (c) 2003 Markus Friedl <markus@openbsd.org>
@@ -97,7 +97,8 @@ geodesc_attach(struct device *parent, struct device *self, void *aux)
reg = pci_conf_read(pa->pa_pc, pa->pa_tag, SC1100_F5_SCRATCHPAD);
sc->sc_iot = pa->pa_iot;
- if (bus_space_map(sc->sc_iot, reg, 64, 0, &sc->sc_ioh)) {
+ if (reg == 0 ||
+ bus_space_map(sc->sc_iot, reg, 64, 0, &sc->sc_ioh)) {
printf(": unable to map registers at 0x%x\n", reg);
return;
}