mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Arnd Bergmann <arnd@kernel.org>, Kalle Valo <kvalo@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>, DeanKu <ku920601@realtek.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] rtw89: use flexible array member in rtw89_btc_btf_tlv
Date: Wed, 24 May 2023 01:24:50 +0000	[thread overview]
Message-ID: <27a7010de8be4006a3e4b95e851781c6@realtek.com> (raw)
In-Reply-To: <20230523113241.2772811-1-arnd@kernel.org>



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Tuesday, May 23, 2023 7:33 PM
> To: Ping-Ke Shih <pkshih@realtek.com>; Kalle Valo <kvalo@kernel.org>
> Cc: Arnd Bergmann <arnd@arndb.de>; DeanKu <ku920601@realtek.com>; linux-wireless@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [PATCH] rtw89: use flexible array member in rtw89_btc_btf_tlv
> 
> From: Arnd Bergmann <arnd@arndb.de>
> 
> struct rtw89_btc_btf_tlv contains a one-byte member that is intended as a
> flexible array:
> 
> In function 'fortify_memcpy_chk',
>     inlined from '_append_tdma' at drivers/net/wireless/realtek/rtw89/coex.c:1579:3:
> include/linux/fortify-string.h:583:25: error: call to '__write_overflow_field' declared with attribute
> warning: detected write beyond size of field (1st parameter); maybe use struct_group()?
> [-Werror=attribute-warning]
>   583 |                         __write_overflow_field(p_size_field, size);
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Make this actually use a flexible array to let the compiler understand.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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

> ---
>  drivers/net/wireless/realtek/rtw89/coex.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c
> index 3a586a971e8f..bda0e1e99a8c 100644
> --- a/drivers/net/wireless/realtek/rtw89/coex.c
> +++ b/drivers/net/wireless/realtek/rtw89/coex.c
> @@ -206,7 +206,7 @@ static const struct rtw89_btc_ver rtw89_btc_ver_defs[] = {
>  struct rtw89_btc_btf_tlv {
>         u8 type;
>         u8 len;
> -       u8 val[1];
> +       u8 val[];
>  } __packed;
> 
>  enum btc_btf_set_report_en {
> --
> 2.39.2


  reply	other threads:[~2023-05-24  1:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 11:32 Arnd Bergmann
2023-05-24  1:24 ` Ping-Ke Shih [this message]
2023-05-24 10:43 ` Gustavo A. R. Silva
2023-05-25 16:14 ` wifi: " Kalle Valo

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=27a7010de8be4006a3e4b95e851781c6@realtek.com \
    --to=pkshih@realtek.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=ku920601@realtek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®