From: Peter Seiderer Date: Sat, 2 Apr 2022 15:30:13 +0000 (+0200) Subject: ath9k: fix ath_get_rate_txpower() to respect the rate list end tag X-Git-Tag: microblaze-v5.20~161^2~193^2^2~34 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=24584d4f0afc75faa57883dd694e0df61af0ad40;p=linux-2.6-microblaze.git ath9k: fix ath_get_rate_txpower() to respect the rate list end tag Stop reading (and copying) from ieee80211_tx_rate to ath_tx_info.rates after list end tag (count == 0, idx < 0), prevents copying of garbage to card registers. Note: no need to write to the remaining ath_tx_info.rates entries as the complete ath_tx_info struct is already initialized to zero from both call sites. Signed-off-by: Peter Seiderer Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220402153014.31332-1-ps.report@gmx.net --- diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index d0caf1de2bde..ec9bad2d9510 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -1271,7 +1271,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int phy; if (!rates[i].count || (rates[i].idx < 0)) - continue; + break; rix = rates[i].idx; info->rates[i].Tries = rates[i].count;