Message ID | 0700c7b9-bfd3-4aa6-82bf-5bf3c74644e1@moroto.mountain |
---|---|
State | New |
Headers | show |
Series | wifi: rtw89: fix a width vs precision bug | expand |
> -----Original Message----- > From: Dan Carpenter <dan.carpenter@linaro.org> > Sent: Tuesday, August 8, 2023 1:36 PM > To: Timlee <timlee@realtek.com> > Cc: Ping-Ke Shih <pkshih@realtek.com>; Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; > kernel-janitors@vger.kernel.org > Subject: [PATCH] wifi: rtw89: fix a width vs precision bug > > The "buf" is skb->data that comes from the firmware. We want to print > "len" number of bytes. But there is a missing period so the "len" > variable is used for formatting (width) instead of limiting the output > (precision). > > Fixes: cad2bd8a136c ("wifi: rtw89: support firmware log with formatted text") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Thanks for the fix. Acked-by: Ping-Ke Shih <pkshih@realtek.com> > --- > drivers/net/wireless/realtek/rtw89/fw.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c > index 2811a94b5f69..bcd9050f989f 100644 > --- a/drivers/net/wireless/realtek/rtw89/fw.c > +++ b/drivers/net/wireless/realtek/rtw89/fw.c > @@ -1165,7 +1165,7 @@ void rtw89_fw_log_dump(struct rtw89_dev *rtwdev, u8 *buf, u32 len) > return; > > plain_log: > - rtw89_info(rtwdev, "C2H log: %*s", len, buf); > + rtw89_info(rtwdev, "C2H log: %.*s", len, buf); > > } > > -- > 2.39.2 > > > ------Please consider the environment before printing this e-mail.
Ping-Ke Shih <pkshih@realtek.com> writes: >> -----Original Message----- >> From: Dan Carpenter <dan.carpenter@linaro.org> >> Sent: Tuesday, August 8, 2023 1:36 PM >> To: Timlee <timlee@realtek.com> >> Cc: Ping-Ke Shih <pkshih@realtek.com>; Kalle Valo >> <kvalo@kernel.org>; linux-wireless@vger.kernel.org; >> kernel-janitors@vger.kernel.org >> Subject: [PATCH] wifi: rtw89: fix a width vs precision bug >> >> The "buf" is skb->data that comes from the firmware. We want to print >> "len" number of bytes. But there is a missing period so the "len" >> variable is used for formatting (width) instead of limiting the output >> (precision). >> >> Fixes: cad2bd8a136c ("wifi: rtw89: support firmware log with formatted text") >> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > > Thanks for the fix. > > Acked-by: Ping-Ke Shih <pkshih@realtek.com> Weird, Ping's reply didn't go to patchwork: https://patchwork.kernel.org/project/linux-wireless/patch/0700c7b9-bfd3-4aa6-82bf-5bf3c74644e1@moroto.mountain/ But I do see it on the list: https://lore.kernel.org/all/63f8219b49604fc9805319c391ee44bf@realtek.com/ Crossing fingers that this was just a random anomaly in patchwork and it's not losing more email.
Dan Carpenter <dan.carpenter@linaro.org> wrote: > The "buf" is skb->data that comes from the firmware. We want to print > "len" number of bytes. But there is a missing period so the "len" > variable is used for formatting (width) instead of limiting the output > (precision). > > Fixes: cad2bd8a136c ("wifi: rtw89: support firmware log with formatted text") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Patch applied to wireless-next.git, thanks. e2a61151ff8c wifi: rtw89: fix a width vs precision bug
diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 2811a94b5f69..bcd9050f989f 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -1165,7 +1165,7 @@ void rtw89_fw_log_dump(struct rtw89_dev *rtwdev, u8 *buf, u32 len) return; plain_log: - rtw89_info(rtwdev, "C2H log: %*s", len, buf); + rtw89_info(rtwdev, "C2H log: %.*s", len, buf); }
The "buf" is skb->data that comes from the firmware. We want to print "len" number of bytes. But there is a missing period so the "len" variable is used for formatting (width) instead of limiting the output (precision). Fixes: cad2bd8a136c ("wifi: rtw89: support firmware log with formatted text") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> --- drivers/net/wireless/realtek/rtw89/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)