Re: [PATCH v3] wifi: mwifiex: replace one-element arrays with flexible array members
From: Francesco Dolcini
Date: Thu Jul 16 2026 - 02:16:51 EST
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>