From: Ping-Ke Shih <pkshih@realtek.com>
To: kernel test robot <lkp@intel.com>
Cc: "oe-kbuild-all@lists.linux.dev" <oe-kbuild-all@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Kalle Valo <kvalo@kernel.org>
Subject: RE: drivers/net/wireless/realtek/rtw89/coex.c:1448:17: warning: writing 8 bytes into a region of size 0
Date: Thu, 2 Nov 2023 00:46:44 +0000 [thread overview]
Message-ID: <92fba00735f3483cbbc77ad986cd7c16@realtek.com> (raw)
In-Reply-To: <202310301908.Wrj0diqe-lkp@intel.com>
> -----Original Message-----
> From: kernel test robot <lkp@intel.com>
> Sent: Monday, October 30, 2023 7:48 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: oe-kbuild-all@lists.linux.dev; linux-kernel@vger.kernel.org; Kalle Valo <kvalo@kernel.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
prev parent reply other threads:[~2023-11-02 0:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 11:48 drivers/net/wireless/realtek/rtw89/coex.c:1448:17: warning: writing 8 bytes into a region of size 0 kernel test robot
2023-11-02 0:46 ` Ping-Ke Shih [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=92fba00735f3483cbbc77ad986cd7c16@realtek.com \
--to=pkshih@realtek.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox