Skip to contentSkip to conversation

rtw89: fix maybe uninitialized `qempty` variable

PATCH In review Íñigo Huguet 3 participants 3 messages Jan 13, 2022 – Jan 28, 2022 Realtek wireless driver (rtw89)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtw89: fix maybe uninitialized `qempty` variable

Call to dle_dfi_qempty might fail, leaving qempty.qempty untouched, which is latter used to control the for loop. If that happens, it's not initialized anywhere.

Initialize it so the loop doesn't iterate unless it's modified by the call to dle_dfi_qempty.

---
 drivers/net/wireless/realtek/rtw89/mac.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtw89/mac.c +1 -0
index afcd07ab1de7..9f73a2303e90 100644
@@ -172,6 +172,7 @@ static void rtw89_mac_dump_qta_lost(struct rtw89_dev *rtwdev)
 
 	qempty.dle_type = DLE_CTRL_TYPE_PLE;
 	qempty.grpsel = 0;
+	qempty.qempty = ~(u32)0;
 	ret = dle_dfi_qempty(rtwdev, &qempty);
 	if (ret)
 		rtw89_warn(rtwdev, "%s: query DLE fail\n", __func__);
Signature · 1 line
2.31.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines

-----Original Message-----
From: Íñigo Huguet <[email protected]>
Sent: Thursday, January 13, 2022 5:43 PM
To: [email protected]
Cc: Pkshih <[email protected]>; [email protected]; Íñigo Huguet <[email protected]>
Subject: [PATCH] rtw89: fix maybe uninitialized qempty variable

Quoted 8 lines

Call to dle_dfi_qempty might fail, leaving qempty.qempty untouched, which is latter used to control the for loop. If that happens, it's not initialized anywhere.

Initialize it so the loop doesn't iterate unless it's modified by the call to dle_dfi_qempty.

[...]

#2 lore raw
In reply to Íñigo Huguet
Quoted 9 lines · Íñigo Huguet

Call to dle_dfi_qempty might fail, leaving qempty.qempty untouched, which is latter used to control the for loop. If that happens, it's not initialized anywhere.

Initialize it so the loop doesn't iterate unless it's modified by the call to dle_dfi_qempty.

Patch applied to wireless-next.git, thanks.

89e4a00ff3c0 rtw89: fix maybe uninitialized qempty variable

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches