From 5c0ad988c9fafee15446d1771718c2401746b243 Mon Sep 17 00:00:00 2001 From: adrian Date: Sat, 10 Aug 2013 21:46:58 +0000 Subject: Add in missing m_free()'s during error conditions. --- sys/net80211/ieee80211_output.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/net80211') diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 7a88018..03c332a 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -396,6 +396,9 @@ ieee80211_start_pkt(struct ieee80211vap *vap, struct mbuf *m) * Start method for vap's. All packets from the stack come * through here. We handle common processing of the packets * before dispatching them to the underlying device. + * + * if_transmit() requires that the mbuf be consumed by this call + * regardless of the return condition. */ int ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m) @@ -410,6 +413,7 @@ ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m) "%s: ignore queue, parent %s not up+running\n", __func__, parent->if_xname); /* XXX stat */ + m_freem(m); return (EINVAL); } if (vap->iv_state == IEEE80211_S_SLEEP) { @@ -417,6 +421,7 @@ ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m) * In power save, wakeup device for transmit. */ ieee80211_new_state(vap, IEEE80211_S_RUN, 0); + m_freem(m); return (0); } /* @@ -435,6 +440,7 @@ ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m) vap->iv_stats.is_tx_badstate++; IEEE80211_UNLOCK(ic); ifp->if_drv_flags |= IFF_DRV_OACTIVE; + m_freem(m); return (EINVAL); } IEEE80211_UNLOCK(ic); -- cgit v1.1