summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoravos <avos@FreeBSD.org>2015-11-05 22:44:36 +0000
committeravos <avos@FreeBSD.org>2015-11-05 22:44:36 +0000
commit71e1af74b88e49a6ce846c21d5d66c8c31f82704 (patch)
tree1e74d788174420c73279dc33219adfdbc6489e34 /sys
parent605ac77cb95c78276ae26f016b69b8154220d7db (diff)
downloadFreeBSD-src-71e1af74b88e49a6ce846c21d5d66c8c31f82704.zip
FreeBSD-src-71e1af74b88e49a6ce846c21d5d66c8c31f82704.tar.gz
iwn(4): various simple fixes
- Fix mbuf leaks in iwn_raw_xmit() and iwn_xmit_task() (regression since r288178). - Check IWN_FLAG_RUNNING flag under lock. - Remove m->m_pkthdr.rcvif initialization (fixed in r283994). - Enclose some values in return statements into parentheses. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4069
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/iwn/if_iwn.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index 907755b..2947db5 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -4852,6 +4852,7 @@ iwn_xmit_task(void *arg0, int pending)
if_inc_counter(ni->ni_vap->iv_ifp,
IFCOUNTER_OERRORS, 1);
ieee80211_free_node(ni);
+ m_freem(m);
}
}
@@ -4872,16 +4873,13 @@ iwn_raw_xmit(struct ieee80211_node *ni, struct mbuf *m,
DPRINTF(sc, IWN_DEBUG_XMIT | IWN_DEBUG_TRACE, "->%s begin\n", __func__);
+ IWN_LOCK(sc);
if ((sc->sc_flags & IWN_FLAG_RUNNING) == 0) {
m_freem(m);
- return ENETDOWN;
+ IWN_UNLOCK(sc);
+ return (ENETDOWN);
}
- /* XXX? net80211 doesn't set this on xmit'ed raw frames? */
- m->m_pkthdr.rcvif = (void *) ni;
-
- IWN_LOCK(sc);
-
/* queue frame if we have to */
if (sc->sc_beacon_wait) {
if (iwn_xmit_queue_enqueue(sc, m) != 0) {
@@ -4909,12 +4907,14 @@ iwn_raw_xmit(struct ieee80211_node *ni, struct mbuf *m,
}
if (error == 0)
sc->sc_tx_timer = 5;
+ else
+ m_freem(m);
IWN_UNLOCK(sc);
DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);
- return error;
+ return (error);
}
/*
OpenPOWER on IntegriCloud