Re: [PATCH] ALSA: au88x0: Fix array bounds warning in EQ drivers

From: Takashi Iwai

Date: Thu Nov 06 2025 - 05:07:06 EST


On Thu, 06 Nov 2025 07:33:39 +0100,
wangdich9700@xxxxxxx wrote:
>
> From: wangdicheng <wangdich9700@xxxxxxx>
>
> In file included from ../sound/pci/au88x0/au8830.c:15:
> In function ʽvortex_Eqlzr_SetAllBandsFromActiveCoeffSetʼ,
> ../sound/pci/au88x0/au88x0_eq.c:571:9: error: ʽvortex_EqHw_SetRightGainsTargetʼ reading 2 bytes from a region of size 0 [-Werror=stringop-overread]
> vortex_EqHw_SetRightGainsTarget(vortex, &(eq->this130[eq->this10]));
>
> Modified the array access in vortex_Eqlzr_SetAllBandsFromActiveCoeffSet() to use pointer arithmetic instead of array indexing.
> This resolves a compiler warning that incorrectly flagged a buffer overread when accessing the EQ gain array.
> The this130 array has fixed size 20 and the index is safely within bounds, making the original code correct but confusing to static analysis.
>
> Signed-off-by: wangdicheng <wangdicheng@xxxxxxxxxx>

Again, please fix From and Signed-off-by addresses.


thanks,

Takashi