summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-07-12 00:01:50 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-07-12 00:01:50 +0000
commit589b4931006050be9acfb3352f2e3d179437b428 (patch)
tree13849b10928b8e24552d8decf78199e918e95030 /sys/dev/pci
parent5d40a7d7ac8821a81c5c82f8d6f9ad6f516411ae (diff)
free resources for Jumbo buffers in sk_stop().
ok deraadt, krw, beck
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_sk.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c
index 1856ddedb98..f88f17adf72 100644
--- a/sys/dev/pci/if_sk.c
+++ b/sys/dev/pci/if_sk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sk.c,v 1.69 2005/07/02 23:10:11 brad Exp $ */
+/* $OpenBSD: if_sk.c,v 1.70 2005/07/12 00:01:49 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -2703,6 +2703,7 @@ sk_stop(struct sk_if_softc *sc_if)
{
struct sk_softc *sc = sc_if->sk_softc;
struct ifnet *ifp = &sc_if->arpcom.ac_if;
+ struct sk_txmap_entry *dma;
int i;
DPRINTFN(2, ("sk_stop\n"));
@@ -2773,8 +2774,17 @@ sk_stop(struct sk_if_softc *sc_if)
if (sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf != NULL) {
m_freem(sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf);
sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf = NULL;
+ SIMPLEQ_INSERT_HEAD(&sc_if->sk_txmap_head,
+ sc_if->sk_cdata.sk_tx_map[i], link);
+ sc_if->sk_cdata.sk_tx_map[i] = 0;
}
}
+
+ while ((dma = SIMPLEQ_FIRST(&sc_if->sk_txmap_head))) {
+ SIMPLEQ_REMOVE_HEAD(&sc_if->sk_txmap_head, link);
+ bus_dmamap_destroy(sc->sc_dmatag, dma->dmamap);
+ free(dma, M_DEVBUF);
+ }
}
struct cfattach skc_ca = {