mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
mt76: fix possible out-of-bound access in mt7615_fill_txs/mt7603_fill_txs
[ Upstream commit e8b970c8e367e85fab9b8ac4f36080e5d653c38e ] Fix possible out-of-bound access of status rates array in mt7615_fill_txs/mt7603_fill_txs routines Fixes:c5211e997e("mt76: mt7603: rework and fix tx status reporting") Fixes:4af81f02b4("mt76: mt7615: sync with mt7603 rate control changes") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
328e10566b
commit
44a9b673a7
2 changed files with 6 additions and 2 deletions
|
|
@ -1032,8 +1032,10 @@ mt7603_fill_txs(struct mt7603_dev *dev, struct mt7603_sta *sta,
|
|||
if (idx && (cur_rate->idx != info->status.rates[i].idx ||
|
||||
cur_rate->flags != info->status.rates[i].flags)) {
|
||||
i++;
|
||||
if (i == ARRAY_SIZE(info->status.rates))
|
||||
if (i == ARRAY_SIZE(info->status.rates)) {
|
||||
i--;
|
||||
break;
|
||||
}
|
||||
|
||||
info->status.rates[i] = *cur_rate;
|
||||
info->status.rates[i].count = 0;
|
||||
|
|
|
|||
|
|
@ -914,8 +914,10 @@ static bool mt7615_fill_txs(struct mt7615_dev *dev, struct mt7615_sta *sta,
|
|||
if (idx && (cur_rate->idx != info->status.rates[i].idx ||
|
||||
cur_rate->flags != info->status.rates[i].flags)) {
|
||||
i++;
|
||||
if (i == ARRAY_SIZE(info->status.rates))
|
||||
if (i == ARRAY_SIZE(info->status.rates)) {
|
||||
i--;
|
||||
break;
|
||||
}
|
||||
|
||||
info->status.rates[i] = *cur_rate;
|
||||
info->status.rates[i].count = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue