summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2004-08-21 07:13:56 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2004-08-21 07:13:56 +0000
commit32776c80bfcf5594d8672cd5bae0ec216147f63c (patch)
tree3c4a8944f305f3962c45553b65515a0761b46ea4 /sys/dev
parent39d77751325629f0dea175bce3f3f51059b2ebb6 (diff)
in case of failure use the same logic for unmapping as it was used for mapping; found and testing by Jack Culpepper <jack@cloudconnector.com>; deraadt@ ok
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/pciide.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c
index 8ca47e1a3ef..e5581720e17 100644
--- a/sys/dev/pci/pciide.c
+++ b/sys/dev/pci/pciide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide.c,v 1.168 2004/06/02 18:55:08 grange Exp $ */
+/* $OpenBSD: pciide.c,v 1.169 2004/08/21 07:13:55 mickey Exp $ */
/* $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $ */
/*
@@ -1635,8 +1635,12 @@ next:
pciide_unmap_compat_intr(pa, cp, channel, interface);
bus_space_unmap(cp->wdc_channel.cmd_iot,
cp->wdc_channel.cmd_ioh, cmdsize);
- bus_space_unmap(cp->wdc_channel.ctl_iot,
- cp->wdc_channel.ctl_ioh, ctlsize);
+ if (interface & PCIIDE_INTERFACE_PCI(channel))
+ bus_space_unmap(cp->wdc_channel.ctl_iot,
+ cp->ctl_baseioh, ctlsize);
+ else
+ bus_space_unmap(cp->wdc_channel.ctl_iot,
+ cp->wdc_channel.ctl_ioh, ctlsize);
}
if (cp->hw_ok) {
cp->wdc_channel.data32iot = cp->wdc_channel.cmd_iot;