summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangdicheng <wangdicheng@kylinos.cn>2025-11-07 10:45:25 +0800
committerTakashi Iwai <tiwai@suse.de>2025-11-08 08:54:40 +0100
commit4b1b92bdc4ca13fd6712cfaa0084d3cfdf76e24c (patch)
tree04450e31ebee056ce5ad8976b59cdcf99e7fa000
parent592d1c23afb287d1eea0c83687203bff9d7e6eb3 (diff)
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>
-rw-r--r--sound/pci/au88x0/au88x0_eq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/au88x0/au88x0_eq.c b/sound/pci/au88x0/au88x0_eq.c
index 71c13100d7ef..81a63b5bb31c 100644
--- a/sound/pci/au88x0/au88x0_eq.c
+++ b/sound/pci/au88x0/au88x0_eq.c
@@ -568,7 +568,7 @@ static int vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex_t * vortex)
eqlzr_t *eq = &(vortex->eq);
vortex_EqHw_SetLeftGainsTarget(vortex, eq->this130);
- vortex_EqHw_SetRightGainsTarget(vortex, &(eq->this130[eq->this10]));
+ vortex_EqHw_SetRightGainsTarget(vortex, eq->this130 + eq->this10);
return 0;
}