summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2002-12-18 15:21:16 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2002-12-18 15:21:16 +0000
commit62f7949cfcc1b577205145028c1247c5c96d1ef2 (patch)
treed05637283a2f43c1f7f01d549172ccae0f2c5d91 /sys
parentceeb46279ea56ce8c50caa7198aa51413319e949 (diff)
fix memory leak when downing an interface.
from Patrik Lindergren <patrik@lindergren.com>
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_em.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 4a0c3e24073..1a7788a55d0 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -1627,6 +1627,11 @@ em_free_transmit_structures(struct em_softc* sc)
if (tx_buffer->m_head != NULL)
m_freem(tx_buffer->m_head);
tx_buffer->m_head = NULL;
+
+ bus_dmamap_unload(sc->osdep.em_pa.pa_dmat,
+ tx_buffer->dmamap);
+ bus_dmamap_destroy(sc->osdep.em_pa.pa_dmat,
+ tx_buffer->dmamap);
}
}
if (sc->tx_buffer_area != NULL) {
@@ -1965,6 +1970,11 @@ em_free_receive_structures(struct em_softc * sc)
if (rx_buffer->m_head != NULL)
m_freem(rx_buffer->m_head);
rx_buffer->m_head = NULL;
+
+ bus_dmamap_unload(sc->osdep.em_pa.pa_dmat,
+ rx_buffer->dmamap);
+ bus_dmamap_destroy(sc->osdep.em_pa.pa_dmat,
+ rx_buffer->dmamap);
}
}
if (sc->rx_buffer_area != NULL) {