LinuxKPI: 802.11 plug mbuf leak in error cases

Manually free the mbuf in certain error cases from net80211 to not
leak it.
Note that the differences between ieee80211_input_mimo() and
ieee80211_input_mimo_all(), the former not consuming the mbuf while
the later does, is confusing.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
This commit is contained in:
Bjoern A. Zeeb 2022-06-05 18:04:57 +00:00
parent 20634f0261
commit dbc06dd98a

View File

@ -3870,6 +3870,7 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
ok = ieee80211_add_rx_params(m, &rx_stats);
if (ok == 0) {
m_freem(m);
counter_u64_add(ic->ic_ierrors, 1);
goto err;
}
@ -3960,8 +3961,11 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
if (ni != NULL) {
ok = ieee80211_input_mimo(ni, m);
ieee80211_free_node(ni);
if (ok < 0)
m_freem(m);
} else {
ok = ieee80211_input_mimo_all(ic, m);
/* mbuf got consumed. */
}
NET_EPOCH_EXIT(et);