Skip to content

Commit 18688c8

Browse files
nbd168jmberg-intel
authored andcommitted
mac80211: fix rate control for retransmitted frames
Since retransmission clears info->control, rate control needs to be called again, otherwise the driver might crash due to invalid rates. Cc: stable@vger.kernel.org # 5.14+ Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi> Reported-by: Robert W <rwbugreport@lost-in-the-void.net> Fixes: 03c3911 ("mac80211: call ieee80211_tx_h_rate_ctrl() when dequeue") Signed-off-by: Felix Fietkau <nbd@nbd.name> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Link: https://lore.kernel.org/r/20211122204323.9787-1-nbd@nbd.name Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent d5e568c commit 18688c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/mac80211/tx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,15 +1822,15 @@ static int invoke_tx_handlers_late(struct ieee80211_tx_data *tx)
18221822
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
18231823
ieee80211_tx_result res = TX_CONTINUE;
18241824

1825+
if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
1826+
CALL_TXH(ieee80211_tx_h_rate_ctrl);
1827+
18251828
if (unlikely(info->flags & IEEE80211_TX_INTFL_RETRANSMISSION)) {
18261829
__skb_queue_tail(&tx->skbs, tx->skb);
18271830
tx->skb = NULL;
18281831
goto txh_done;
18291832
}
18301833

1831-
if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
1832-
CALL_TXH(ieee80211_tx_h_rate_ctrl);
1833-
18341834
CALL_TXH(ieee80211_tx_h_michael_mic_add);
18351835
CALL_TXH(ieee80211_tx_h_sequence);
18361836
CALL_TXH(ieee80211_tx_h_fragment);

0 commit comments

Comments
 (0)