aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/wlan/if_uath.c
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2015-10-12 03:27:08 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2015-10-12 03:27:08 +0000
commitd07be335a06c19be4624487245b2acfe64f55cc3 (patch)
tree1b2473150d991e361c2b7c638b1825555a2fff7c /sys/dev/usb/wlan/if_uath.c
parent5668d203ed5d29b977c71ab62e10b85d6f115b88 (diff)
downloadsrc-d07be335a06c19be4624487245b2acfe64f55cc3.tar.gz
src-d07be335a06c19be4624487245b2acfe64f55cc3.zip
net80211: separate mbuf cleanup from ieee80211_fragment()
* Create ieee80211_free_mbuf() which frees a list of mbufs. * Use it in the fragment transmit path and ath / uath transmit paths. * Call it in xmit_pkt() if the transmission fails; otherwise fragments may be leaked. This should be a big no-op. Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3769
Notes
Notes: svn path=/head/; revision=289162
Diffstat (limited to 'sys/dev/usb/wlan/if_uath.c')
-rw-r--r--sys/dev/usb/wlan/if_uath.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c
index 39fa71b28638..292bb9f6626e 100644
--- a/sys/dev/usb/wlan/if_uath.c
+++ b/sys/dev/usb/wlan/if_uath.c
@@ -1663,22 +1663,6 @@ uath_txfrag_setup(struct uath_softc *sc, uath_datahead *frags,
return !STAILQ_EMPTY(frags);
}
-/*
- * Reclaim mbuf resources. For fragmented frames we need to claim each frag
- * chained with m_nextpkt.
- */
-static void
-uath_freetx(struct mbuf *m)
-{
- struct mbuf *next;
-
- do {
- next = m->m_nextpkt;
- m->m_nextpkt = NULL;
- m_freem(m);
- } while ((m = next) != NULL);
-}
-
static int
uath_transmit(struct ieee80211com *ic, struct mbuf *m)
{
@@ -1735,7 +1719,7 @@ uath_start(struct uath_softc *sc)
!uath_txfrag_setup(sc, &frags, m, ni)) {
DPRINTF(sc, UATH_DEBUG_XMIT,
"%s: out of txfrag buffers\n", __func__);
- uath_freetx(m);
+ ieee80211_free_mbuf(m);
goto bad;
}
sc->sc_seqnum = 0;
@@ -1770,7 +1754,7 @@ uath_start(struct uath_softc *sc)
"%s: flush fragmented packet, state %s\n",
__func__,
ieee80211_state_name[ni->ni_vap->iv_state]);
- uath_freetx(next);
+ ieee80211_free_mbuf(next);
goto reclaim;
}
m = next;