All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtw89: fix maybe uninitialized `qempty` variable
@ 2022-01-13  9:42 Íñigo Huguet
  2022-01-14  1:07 ` Pkshih
  2022-01-28 15:57 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Íñigo Huguet @ 2022-01-13  9:42 UTC (permalink / raw)
  To: linux-wireless; +Cc: pkshih, kvalo, Íñ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.

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
---
 drivers/net/wireless/realtek/rtw89/mac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index afcd07ab1de7..9f73a2303e90 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -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__);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] rtw89: fix maybe uninitialized `qempty` variable
  2022-01-13  9:42 [PATCH] rtw89: fix maybe uninitialized `qempty` variable Íñigo Huguet
@ 2022-01-14  1:07 ` Pkshih
  2022-01-28 15:57 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Pkshih @ 2022-01-14  1:07 UTC (permalink / raw)
  To: Íñigo Huguet, linux-wireless; +Cc: kvalo


> -----Original Message-----
> From: Íñigo Huguet <ihuguet@redhat.com>
> Sent: Thursday, January 13, 2022 5:43 PM
> To: linux-wireless@vger.kernel.org
> Cc: Pkshih <pkshih@realtek.com>; kvalo@kernel.org; Íñigo Huguet <ihuguet@redhat.com>
> Subject: [PATCH] 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.
> 
> Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

[...]


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtw89: fix maybe uninitialized `qempty` variable
  2022-01-13  9:42 [PATCH] rtw89: fix maybe uninitialized `qempty` variable Íñigo Huguet
  2022-01-14  1:07 ` Pkshih
@ 2022-01-28 15:57 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2022-01-28 15:57 UTC (permalink / raw)
  To: Íñigo Huguet; +Cc: linux-wireless, pkshih, Íñigo Huguet

Íñigo Huguet <ihuguet@redhat.com> wrote:

> 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.
> 
> Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-next.git, thanks.

89e4a00ff3c0 rtw89: fix maybe uninitialized `qempty` variable

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20220113094253.73370-1-ihuguet@redhat.com/

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-28 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13  9:42 [PATCH] rtw89: fix maybe uninitialized `qempty` variable Íñigo Huguet
2022-01-14  1:07 ` Pkshih
2022-01-28 15:57 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.