summaryrefslogtreecommitdiff
path: root/sys/dev/isa
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-28 09:38:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-28 09:38:49 +0000
commit76f93a5cf1607dfadeb2ff19d83423a1efd484f6 (patch)
treee610a26d500049bbb4677b13b6dc8e398de18096 /sys/dev/isa
parentaed97c5684288418fbbce8d1f11ef2ef4f83e0e5 (diff)
carefully clear r->h, and avoid a panic
Diffstat (limited to 'sys/dev/isa')
-rw-r--r--sys/dev/isa/isapnp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/isa/isapnp.c b/sys/dev/isa/isapnp.c
index 4e287719415..8a8e0295e6a 100644
--- a/sys/dev/isa/isapnp.c
+++ b/sys/dev/isa/isapnp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isapnp.c,v 1.21 1998/11/30 10:44:55 deraadt Exp $ */
+/* $OpenBSD: isapnp.c,v 1.22 1998/12/28 09:38:48 deraadt Exp $ */
/* $NetBSD: isapnp.c,v 1.9.4.3 1997/10/29 00:40:43 thorpej Exp $ */
/*
@@ -201,6 +201,7 @@ isapnp_free_region(t, r)
#ifdef _KERNEL
bus_space_unmap(t, r->h, r->length);
#endif
+ r->h = NULL;
}
@@ -217,6 +218,7 @@ isapnp_alloc_region(t, r)
if (r->length == 0)
return 0;
+ r->h = NULL;
for (r->base = r->minbase; r->base <= r->maxbase;
r->base += r->align) {
#ifdef _KERNEL
@@ -871,8 +873,10 @@ isapnp_attach(parent, self, aux)
if (isapnp_map(sc))
panic("%s: bus map failed\n", sc->sc_dev.dv_xname);
- if (!isapnp_find(sc, 1))
- panic("%s: no cards found\n", sc->sc_dev.dv_xname);
+ if (!isapnp_find(sc, 1)) {
+ printf(": no cards found\n", sc->sc_dev.dv_xname);
+ return;
+ }
printf(": read port 0x%x\n", sc->sc_read_port);