iwi, ral, zyd: fix possible use-after-free.

MFC after:	5 days
This commit is contained in:
Andriy Voskoboinyk 2017-02-17 23:20:22 +00:00
parent e36b831f4b
commit ce017db11c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313906
3 changed files with 3 additions and 3 deletions

View File

@ -1979,9 +1979,9 @@ iwi_start(struct iwi_softc *sc)
}
ni = (struct ieee80211_node *) m->m_pkthdr.rcvif;
if (iwi_tx_start(sc, m, ni, ac) != 0) {
ieee80211_free_node(ni);
if_inc_counter(ni->ni_vap->iv_ifp,
IFCOUNTER_OERRORS, 1);
ieee80211_free_node(ni);
break;
}
sc->sc_tx_timer = 5;

View File

@ -1616,9 +1616,9 @@ rt2661_start(struct rt2661_softc *sc)
}
ni = (struct ieee80211_node *) m->m_pkthdr.rcvif;
if (rt2661_tx_data(sc, m, ni, ac) != 0) {
ieee80211_free_node(ni);
if_inc_counter(ni->ni_vap->iv_ifp,
IFCOUNTER_OERRORS, 1);
ieee80211_free_node(ni);
break;
}
sc->sc_tx_timer = 5;

View File

@ -2582,10 +2582,10 @@ zyd_start(struct zyd_softc *sc)
while (sc->tx_nfree > 0 && (m = mbufq_dequeue(&sc->sc_snd)) != NULL) {
ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
if (zyd_tx_start(sc, m, ni) != 0) {
ieee80211_free_node(ni);
m_freem(m);
if_inc_counter(ni->ni_vap->iv_ifp,
IFCOUNTER_OERRORS, 1);
ieee80211_free_node(ni);
break;
}
}