summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2000-03-22 01:35:14 +0000
committerthorpej <thorpej@NetBSD.org>2000-03-22 01:35:14 +0000
commited332d840a08c4001ecf76a486ec57e59f47a36a (patch)
tree025fe910f9d2c0a5016f69feffb18645ae74de66 /sys/dev
parent86e14c4a11178f0372fa181903c910b35372fa23 (diff)
In tlp_cardbus_detach(), only unmap the bus space if we were able to
map it in the first place. Pointed out by enami@netbsd.org.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cardbus/if_tlp_cardbus.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/cardbus/if_tlp_cardbus.c b/sys/dev/cardbus/if_tlp_cardbus.c
index 65e226114ce..f9c2804aeed 100644
--- a/sys/dev/cardbus/if_tlp_cardbus.c
+++ b/sys/dev/cardbus/if_tlp_cardbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tlp_cardbus.c,v 1.21 2000/03/19 21:45:24 thorpej Exp $ */
+/* $NetBSD: if_tlp_cardbus.c,v 1.22 2000/03/22 01:35:14 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -392,8 +392,9 @@ tlp_cardbus_detach(self, flags)
/*
* Release bus space and close window.
*/
- Cardbus_mapreg_unmap(ct, csc->sc_bar_reg, sc->sc_st, sc->sc_sh,
- csc->sc_mapsize);
+ if (csc->sc_bar_reg != 0)
+ Cardbus_mapreg_unmap(ct, csc->sc_bar_reg,
+ sc->sc_st, sc->sc_sh, csc->sc_mapsize);
return (0);
}