Skip to contentSkip to conversation

wifi: rtw89: debug: fix off by on in rtw89_ppdu_str()

PATCH In review Dan Carpenter 2 participants 3 messages Jun 8 – Jul 3

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: rtw89: debug: fix off by on in rtw89_ppdu_str()

This > comparison should be >= to avoid an out of bounds access.

Fixes 419ed7f4a053 ("wifi: rtw89: debug: extend bb_info with TX status and PER")
---
 drivers/net/wireless/realtek/rtw89/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw89/debug.c +1 -1
index 8f5af873e09f..5786120602ab 100644
@@ -4348,7 +4348,7 @@ static const char *rtw89_ppdu_str(struct rtw89_dev *rtwdev, u8 type, u8 subtype)
 	const struct rtw89_chip_info *chip = rtwdev->chip;
 	const struct rtw89_ppdu_info *ppdu_info;
 
-	if (type > ARRAY_SIZE(rtw89_ppdu_infos))
+	if (type >= ARRAY_SIZE(rtw89_ppdu_infos))
 		return "RSVD";
 
 	ppdu_info = &rtw89_ppdu_infos[type];
Signature · 1 line
2.53.0
maintainer
#2 lore raw
In reply to Dan Carpenter
Quoted 5 lines · Dan Carpenter

This > comparison should be >= to avoid an out of bounds access.

Fixes 419ed7f4a053 ("wifi: rtw89: debug: extend bb_info with TX status and PER")

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

1908534deb53 wifi: rtw89: debug: fix off by on in rtw89_ppdu_str()

---
https://github.com/pkshih/rtw.git