From 62f7949cfcc1b577205145028c1247c5c96d1ef2 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 18 Dec 2002 15:21:16 +0000 Subject: fix memory leak when downing an interface. from Patrik Lindergren --- sys/dev/pci/if_em.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/dev/pci/if_em.c') 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) { -- cgit v1.2.3