Re: [PATCH v3] wifi: mwifiex: replace one-element arrays with flexible array members

From: Dan Carpenter

Date: Thu Jul 16 2026 - 02:27:47 EST


On Thu, Jul 16, 2026 at 08:16:38AM +0200, Francesco Dolcini wrote:
> On Thu, Jul 16, 2026 at 03:17:28AM +0300, Georgi Valkov wrote:
> > Replace deprecated one-element arrays with flexible array members.
> > CONFIG_FORTIFY_SOURCE reports the following warning when
> > one-element arrays are used as variable-length buffers:
> >
> > sta_cmd.c:1033 mwifiex_sta_prepare_cmd
> > memcpy: detected field-spanning write (size 84) of single field
> > "domain->triplet" at .../marvell/mwifiex/sta_cmd.c:1033 (size 3)
> >
> > Convert affected structs to use flexible array members.
> > - Preserve existing wire layouts.
> > - Use DECLARE_FLEX_ARRAY() for structs inside affected unions.
> >
> > Tested-on: WRT3200ACM, OpenWrt
> > Signed-off-by: Georgi Valkov <gvalkov@xxxxxxxxx>
>
> Cc: stable@xxxxxxxxxxxxxxx # 6.12+
> Reviewed-by: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>

Are we CCing stable for this sort of thing? How many FORTIFY_SOURCE
warnings are still remaining?

regards,
dan carpenter