[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <92fba00735f3483cbbc77ad986cd7c16@realtek.com>
Date: Thu, 2 Nov 2023 00:46:44 +0000
From: Ping-Ke Shih <pkshih@...ltek.com>
To: kernel test robot <lkp@...el.com>
CC: "oe-kbuild-all@...ts.linux.dev" <oe-kbuild-all@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Kalle Valo <kvalo@...nel.org>
Subject: RE: drivers/net/wireless/realtek/rtw89/coex.c:1448:17: warning: writing 8 bytes into a region of size 0
> -----Original Message-----
> From: kernel test robot <lkp@...el.com>
> Sent: Monday, October 30, 2023 7:48 PM
> To: Ping-Ke Shih <pkshih@...ltek.com>
> Cc: oe-kbuild-all@...ts.linux.dev; linux-kernel@...r.kernel.org; Kalle Valo <kvalo@...nel.org>
> Subject: drivers/net/wireless/realtek/rtw89/coex.c:1448:17: warning: writing 8 bytes into a region of size
> 0
drivers/net/wireless/realtek/rtw89/coex.c: In function '_append_tdma':
>> drivers/net/wireless/realtek/rtw89/coex.c:1448:17: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]
1448 | memcpy(v, &dm->tdma, sizeof(*v));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> e3ec7017f6a20d Ping-Ke Shih 2021-10-11 1442
> e3ec7017f6a20d Ping-Ke Shih 2021-10-11 1443 tlv = (struct rtw89_btc_btf_tlv *)&btc->policy[len];
> e3ec7017f6a20d Ping-Ke Shih 2021-10-11 1444 tlv->type = CXPOLICY_TDMA;
> ce986f3dc4fc69 Ching-Te Ku 2022-07-25 1445 if (chip->chip_id == RTL8852A) {
> ce986f3dc4fc69 Ching-Te Ku 2022-07-25 1446 v = (struct rtw89_btc_fbtc_tdma *)&tlv->val[0];
> e3ec7017f6a20d Ping-Ke Shih 2021-10-11 1447 tlv->len = sizeof(*v);
> e3ec7017f6a20d Ping-Ke Shih 2021-10-11 @1448 memcpy(v, &dm->tdma, sizeof(*v));
This statement is to append a struct named rtw89_btc_fbtc_tdma to value field of
a TLV struct, but compiler warns dst of memcpy() because of tlv->val[]. Maybe,
this is a false alarm?
Anyway, for this case, a simple assignment "*v = dm->tdma;" would be easier to
understand what it wants and also avoid compiler warnings. Then, I sent a
patch [1] for this.
[1] https://lore.kernel.org/linux-wireless/20231102003716.25815-1-pkshih@realtek.com/T/#u
Powered by blists - more mailing lists