Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7C960CCF9E3 for ; Tue, 4 Nov 2025 07:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=1QSw+y5HT3TcUyd3F/MxUjly0CwHD5TKPc20p//UxFU=; b=ctPNpVwJc0cFWv9WlFwad6SajE mloWpXs/lPPPS/Ff9sEO+lFJzI9MPgQtTVqRVquKko4Tz0t+Y4abkQabKXG/+SrldrnoarRq+LxB5 9mKtzmLZ59V4Gg2XnI0oiX4SybzWE9WyyzRX8i3o8BYoIaT4W0C+h+6P2ZAYor5pDeJ9uVslBXp5u HT2cMFjd1/d1h43p1RSTG+mNpzOBvNsmNlejvEFf2oJpKyLuR46r9lOGdTVc02h5xRptSWn73dL12 xK/GPKhVfjQkDTIKDdk7kI6R7fExOdOOmTR0lIOK3B9had9czOm91+KXvz4C64ZO0/ItQ3cQbUHkn rhQyMP8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGBRj-0000000BKBu-1BL4; Tue, 04 Nov 2025 07:27:15 +0000 Received: from m16.mail.163.com ([220.197.31.2]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGBRg-0000000BKAA-0sG6 for linux-arm-kernel@lists.infradead.org; Tue, 04 Nov 2025 07:27:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version: Content-Type; bh=1QSw+y5HT3TcUyd3F/MxUjly0CwHD5TKPc20p//UxFU=; b=Dfb2nEYLHz9ugFUai5yaYyh41iCkUtEucW/HteS14/qsk5VLqFehetkHer7Ff+ nUoMz3NzdnuIIVSRaQ4mMT6oal7cqK5mjaqqcuNzwdV3W8vY/pQ+gXISzoOjmGv1 eTk0u6SNsBz9aC0dRPDcaRVlZrEDeFmNkRRZQ2BsDE10k= Received: from localhost.localdomain (unknown []) by gzga-smtp-mtada-g1-0 (Coremail) with SMTP id _____wDn74SuqglpdwI+Bg--.673S2; Tue, 04 Nov 2025 15:26:40 +0800 (CST) From: wangdich9700@163.com To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, wangdicheng , wangdicheng Subject: [PATCH] ALSA: au88x0: Fix array bounds warning in EQ drivers Date: Tue, 4 Nov 2025 15:26:36 +0800 Message-Id: <20251104072636.93214-1-wangdich9700@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wDn74SuqglpdwI+Bg--.673S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7ZF47JryDCrW7Cry8tr1kKrg_yoW8XFWfpr Z3C3s7ArWUJrsrCwnYva1UZ34UJFs8XayxAa12kws7Cws8JFWUGr90k3yDJw4IvrZxCF1F 9FW7Xw13J3Z8JaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pEGYLsUUUUU= X-Originating-IP: [116.128.244.169] X-CM-SenderInfo: pzdqwv5lfkmliqq6il2tof0z/1tbibhH7T2kJpNSSNwAAs+ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251103_232712_580768_4C8AD717 X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: wangdicheng 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 --- 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