[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251104072636.93214-1-wangdich9700@163.com>
Date: Tue, 4 Nov 2025 15:26:36 +0800
From: wangdich9700@....com
To: lgirdwood@...il.com,
broonie@...nel.org,
perex@...ex.cz,
tiwai@...e.com
Cc: linux-kernel@...r.kernel.org,
alsa-devel@...a-project.org,
linux-arm-kernel@...ts.infradead.org,
wangdicheng <wangdich9700@....com>,
wangdicheng <wangdicheng@...inos.cn>
Subject: [PATCH] ALSA: au88x0: Fix array bounds warning in EQ drivers
From: wangdicheng <wangdich9700@....com>
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@...inos.cn>
---
sound/pci/au88x0/au88x0_eq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.25.1
Powered by blists - more mailing lists