summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2006-08-10 04:25:15 +0000
committerbrad <brad@openbsd.org>2006-08-10 04:25:15 +0000
commit6adc3ba90107e96e35f2581e0c55ce2c81a3b58c (patch)
treef56cfc544256cfcc382c31dc84757cf8f31c10a5
parentcosmetic tweaking. (diff)
downloadwireguard-openbsd-6adc3ba90107e96e35f2581e0c55ce2c81a3b58c.tar.xz
wireguard-openbsd-6adc3ba90107e96e35f2581e0c55ce2c81a3b58c.zip
unmap memory address space in bnx_release_resources().
-rw-r--r--sys/dev/pci/if_bnx.c8
-rw-r--r--sys/dev/pci/if_bnxreg.h3
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c
index 5215e219201..4880098ffe5 100644
--- a/sys/dev/pci/if_bnx.c
+++ b/sys/dev/pci/if_bnx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bnx.c,v 1.6 2006/08/10 04:13:09 brad Exp $ */
+/* $OpenBSD: if_bnx.c,v 1.7 2006/08/10 04:25:15 brad Exp $ */
/*-
* Copyright (c) 2006 Broadcom Corporation
@@ -354,7 +354,6 @@ bnx_attach(struct device *parent, struct device *self, void *aux)
struct ifnet *ifp;
u_int32_t val;
pcireg_t memtype;
- bus_size_t size;
sc->bnx_pa = *pa;
@@ -367,7 +366,7 @@ bnx_attach(struct device *parent, struct device *self, void *aux)
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
if (pci_mapreg_map(pa, BNX_PCI_BAR0,
memtype, 0, &sc->bnx_btag, &sc->bnx_bhandle,
- NULL, &size, 0) == 0)
+ NULL, &sc->bnx_size, 0) == 0)
break;
default:
printf(": can't find mem space\n");
@@ -2211,6 +2210,9 @@ bnx_release_resources(struct bnx_softc *sc)
if (sc->bnx_intrhand != NULL)
pci_intr_disestablish(pa->pa_pc, sc->bnx_intrhand);
+ if (sc->bnx_size)
+ bus_space_unmap(sc->bnx_btag, sc->bnx_bhandle, sc->bnx_size);
+
DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __FUNCTION__);
}
diff --git a/sys/dev/pci/if_bnxreg.h b/sys/dev/pci/if_bnxreg.h
index d0b532aea73..337dca6a0ee 100644
--- a/sys/dev/pci/if_bnxreg.h
+++ b/sys/dev/pci/if_bnxreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bnxreg.h,v 1.6 2006/08/10 04:01:52 brad Exp $ */
+/* $OpenBSD: if_bnxreg.h,v 1.7 2006/08/10 04:25:15 brad Exp $ */
/*-
* Copyright (c) 2006 Broadcom Corporation
@@ -4619,6 +4619,7 @@ struct bnx_softc
bus_space_tag_t bnx_btag; /* Device bus tag */
bus_space_handle_t bnx_bhandle; /* Device bus handle */
+ bus_size_t bnx_size;
void *bnx_intrhand; /* Interrupt handler */
void *bnx_powerhook;