summaryrefslogtreecommitdiff
path: root/sys/dev/pci/piixpm.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-12-11 18:16:38 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-12-11 18:16:38 +0000
commitcf8c382c7360f5cca81208b17363bcea5f55a4b7 (patch)
tree7958440b60fd62a411b6beac6e1219a424250f5b /sys/dev/pci/piixpm.c
parent7ccdcd3c5ea86264604d56b0d8b94ac6cc5d3e68 (diff)
do not bus_space_map devices which are at address 0; ok kettenis
Diffstat (limited to 'sys/dev/pci/piixpm.c')
-rw-r--r--sys/dev/pci/piixpm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/piixpm.c b/sys/dev/pci/piixpm.c
index 9635cc155e5..49956c2fd80 100644
--- a/sys/dev/pci/piixpm.c
+++ b/sys/dev/pci/piixpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: piixpm.c,v 1.24 2006/09/28 18:19:14 grange Exp $ */
+/* $OpenBSD: piixpm.c,v 1.25 2006/12/11 18:16:37 deraadt Exp $ */
/*
* Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -127,7 +127,8 @@ piixpm_attach(struct device *parent, struct device *self, void *aux)
/* Map I/O space */
sc->sc_iot = pa->pa_iot;
base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_BASE) & 0xffff;
- if (bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
+ if (PCI_MAPREG_IO_ADDR(base) == 0 ||
+ bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
PIIX_SMB_SIZE, 0, &sc->sc_ioh)) {
printf(": can't map I/O space\n");
return;