From: Ian Rogers <irogers@google.com>
To: Srinivas Kandagatla <srini@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
Elkin Cruz <elkin@google.com>, Ian Rogers <irogers@google.com>
Subject: [PATCH 1/2] ASoC: codecs: lpass-rx-macro: Return early for non-HPH interpolators in HD2 control
Date: Thu, 19 Nov 2026 09:07:58 -0800 [thread overview]
Message-ID: <8af31a87f52c4cebc5ac7db6696a91545adb6ac4.1795106962.git.irogers@google.com> (raw)
In-Reply-To: <cover.1795106962.git.irogers@google.com>
rx_macro_enable_interp() invokes rx_macro_hd2_control() whenever
rx->hph_hd2_mode is enabled, including for INTERP_AUX. However,
rx_macro_hd2_control() only assigns hd2_scale_reg and hd2_enable_reg for
INTERP_HPHL and INTERP_HPHR, leaving both u16 register offsets
uninitialized on the stack for INTERP_AUX before testing
'if (hd2_enable_reg && ...)' and writing to random codec register
addresses.
Return immediately in the default branch of switch (interp_idx).
Found via an x86_64 LLVM=1 (Clang 21.1.8) allyesconfig audit with
-Wconditional-uninitialized enabled; fix and changelog drafted with an AI
coding assistant. Build-tested under LLVM=1 W=1 (-Werror) and
-Wconditional-uninitialized; not tested on Qualcomm LPASS audio hardware.
Fixes: 4f692926f562 ("ASoC: codecs: lpass-rx-macro: add dapm widgets and route")
Signed-off-by: Ian Rogers <irogers@google.com>
---
sound/soc/codecs/lpass-rx-macro.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
index ab8a1c2b0489..84a3a47cf932 100644
--- a/sound/soc/codecs/lpass-rx-macro.c
+++ b/sound/soc/codecs/lpass-rx-macro.c
@@ -2414,6 +2414,8 @@ static void rx_macro_hd2_control(struct snd_soc_component *component,
hd2_scale_reg = CDC_RX_RXn_RX_PATH_SEC3(rx, 1);
hd2_enable_reg = CDC_RX_RXn_RX_PATH_CFG0(rx, 1);
break;
+ default:
+ return;
}
if (hd2_enable_reg && SND_SOC_DAPM_EVENT_ON(event)) {
--
2.56.1.708.g77570a6a1d-goog
next prev parent reply other threads:[~2026-11-19 17:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 17:07 [PATCH 0/2] ASoC: qcom: Two fixes from Clang warning audit Ian Rogers
2026-11-19 17:07 ` Ian Rogers [this message]
2026-11-19 17:07 ` [PATCH 2/2] ASoC: qcom: lpass-platform: Return IRQ_NONE on invalid DAI ID in DMA ISR Ian Rogers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8af31a87f52c4cebc5ac7db6696a91545adb6ac4.1795106962.git.irogers@google.com \
--to=irogers@google.com \
--cc=broonie@kernel.org \
--cc=elkin@google.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=perex@perex.cz \
--cc=srini@kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®