From nobody Thu Apr 9 11:56:02 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 555CC3E5567 for ; Mon, 9 Mar 2026 16:03:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773072193; cv=none; b=dLsnPncX/00zmek0ySveDp0KSGUSgwVlbWFqoMwmJnxUzAMLcpAvIFcmQG1isIVs6Efr9tX2xPY9s9+YKFC5lWHiX42oPR4lkP4F2C6zy0gGvYMlGer1PZVGQfsL79BkytwCFVKc697M78aO2JrVyCp6ahZpvKrSdpZ6i9TXSoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773072193; c=relaxed/simple; bh=mUMJwMeGQ+VHbJdW4aby8iHdbxkqijdRHjdJzO+zAbU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m8Q8HGolmfNTjnXHqqNQYWfQSh+U3yXOuUG8kGywL3PlGkcAx9H5Skl4wzwJvDMd06Isu15lffuxakQxtJEPzFFvclhz/wBXoRUSebC9yvlw6lzbmctKaXsPSOYGnvKZgfQmvVEPt4xvr84tG3xqu1JXtzL9s+P2LBT9mpQVgng= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XStoUOAL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XStoUOAL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90648C2BCB0; Mon, 9 Mar 2026 16:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773072192; bh=mUMJwMeGQ+VHbJdW4aby8iHdbxkqijdRHjdJzO+zAbU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XStoUOAL03h2EwbyyAYht8WVaO/86HCW9Nv1KEH51oi6IhSpPCKhnOfwqdKSexu+U gpHyrwTrnmSogM5EmK68ml0+la+8JaSdOvprYCNKjfx0gZVwB+EwBl0shn8HbU3OiX UkLGrMDLo7AXB5vrWEOlIozoH+CdVgfr6WQ/qOMI0CvY327g2YHsxU0cEkW7+ZnRaM 1LCjL7cB1X+0Y96iCh0d45mICjNOZuQMwcRuHUIFonK8/CdRmsugTU1uAunbe3XkY5 Kc/dSmHNtJlHoMri2z5PtqKs8nWq+Vm4fv3Kd/4FdU8LKAJZhz2ocjPQvump931tBj TsRw0tAOBn1/A== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Peter Zijlstra , Nathan Chancellor , Srinivas Kandagatla , Liam Girdwood , Mark Brown Subject: [PATCH 2/3] ASoC: codecs: wcd9335: Remove potential undefined behavior in wcd9335_slimbus_irq() Date: Mon, 9 Mar 2026 09:03:06 -0700 Message-ID: <08dbb63519ef31a5457e07673b7b256fecb5989b.1773071992.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If 'port_id' is negative, the shift counts in wcd9335_slimbus_irq() also become negative, resulting in undefined behavior due to shift out of bounds. That appears to be not possible, but with UBSAN enabled, Clang's range analysis isn't always able to determine that and generates undefined behavior. As a result the code generation isn't optimal, and undefined behavior should be avoided regardless. Improve code generation and remove the undefined behavior by converting the signed variables to unsigned. Fixes the following warning: sound/soc/codecs/wcd9335.o: warning: objtool: wcd9335_slimbus_irq() falls= through to next function __cfi_wcd9335_set_channel_map() This is very similar to a previous fix to wcd934x with commit 060aed9c0093 ("objtool, ASoC: codecs: wcd934x: Remove potential undefined behavior in wcd934x_slim_irq_handler()"). Cc: Srinivas Kandagatla Cc: Liam Girdwood Cc: Mark Brown Reported-by: Arnd Bergmann Closes: https://lore.kernel.org/a426d669-58bb-4be1-9eaa-6f3d83109e2d@app.fa= stmail.com Signed-off-by: Josh Poimboeuf Reviewed-by: Srinivas Kandagatla --- sound/soc/codecs/wcd9335.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c index 640e43ee1975..e3ca5ca6de3d 100644 --- a/sound/soc/codecs/wcd9335.c +++ b/sound/soc/codecs/wcd9335.c @@ -3907,7 +3907,7 @@ static irqreturn_t wcd9335_slimbus_irq(int irq, void = *data) { struct wcd9335_codec *wcd =3D data; unsigned long status =3D 0; - int i, j, port_id; + unsigned int i, j, port_id; unsigned int val, int_val =3D 0; irqreturn_t ret =3D IRQ_NONE; bool tx; --=20 2.53.0