Skip to content

Commit 4b1b92b

Browse files
wangdichengtiwai
authored andcommitted
ALSA: au88x0: Fix array bounds warning in EQ drivers
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@kylinos.cn> Link: https://patch.msgid.link/20251107024525.38454-1-wangdich9700@163.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 592d1c2 commit 4b1b92b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/pci/au88x0/au88x0_eq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ static int vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex_t * vortex)
568568
eqlzr_t *eq = &(vortex->eq);
569569

570570
vortex_EqHw_SetLeftGainsTarget(vortex, eq->this130);
571-
vortex_EqHw_SetRightGainsTarget(vortex, &(eq->this130[eq->this10]));
571+
vortex_EqHw_SetRightGainsTarget(vortex, eq->this130 + eq->this10);
572572

573573
return 0;
574574
}

0 commit comments

Comments
 (0)