Commit 7f626c5
wifi: mt76: mt7925: fix potential tx_retries underflow
mainline inclusion
from mainline-v7.2-rc1
category: bugfix
When FIELD_GET returns 0 for the retry count, subtracting 1 causes
an unsigned integer underflow, resulting in tx_retries becoming a
very large value (0xFFFFFFFF for u32).
Fix by checking if count is non-zero before subtracting 1.
Fixes: c948b5d ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Link: https://patch.msgid.link/20260605113306.3485554-3-ryder.lee@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 1e1fd84571e62a2961cea44c053340ec5c99b2cb)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>1 parent 55c0ae6 commit 7f626c5
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1150 | 1150 | | |
1151 | 1151 | | |
1152 | 1152 | | |
1153 | | - | |
1154 | | - | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1155 | 1156 | | |
1156 | 1157 | | |
1157 | 1158 | | |
| |||
0 commit comments