* [PATCH] ASoC: cs35l56: Fix possible uninitialized value in cs35l56_spi_system_reset()
@ 2026-06-11 13:22 Richard Fitzgerald
2026-06-11 14:07 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2026-06-11 13:22 UTC (permalink / raw)
To: broonie; +Cc: linux-sound, linux-kernel, patches
In cs35l56_spi_system_reset() initialize val to zero before using it in
the read_poll_timeout(). This prevents testing an uninitialized value if
the regmap_read_bypassed() returns an error.
Read errors are intentionally ignored during this loop because the
device is resetting (though SPI can't really detect that so shouldn't
fail because of that, it's safer to ignore errors and keep polling).
Because of this, val must be initialized to something in case the first
read fails. The polling loop is looking for a non-zero value, so
initializing val to 0 will ensure that the loop continues until a valid
state is read from the device or it times out.
Fixes: 769c1b79295c ("ASoC: cs35l56: Prevent races when soft-resetting using SPI control")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
Mark,
This is for-next. Not urgent.
sound/soc/codecs/cs35l56-shared.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c
index 90e52a678e71..d9f237bf8168 100644
--- a/sound/soc/codecs/cs35l56-shared.c
+++ b/sound/soc/codecs/cs35l56-shared.c
@@ -534,6 +534,7 @@ static void cs35l56_spi_system_reset(struct cs35l56_base *cs35l56_base)
* The regmap must remain in cache-only until the chip has
* booted, so use a bypassed read.
*/
+ val = 0;
ret = read_poll_timeout(regmap_read_bypassed, read_ret,
(val > 0) && (val < 0xffffffff),
CS35L56_HALO_STATE_POLL_US,
--
2.47.3
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: cs35l56: Fix possible uninitialized value in cs35l56_spi_system_reset()
2026-06-11 13:22 [PATCH] ASoC: cs35l56: Fix possible uninitialized value in cs35l56_spi_system_reset() Richard Fitzgerald
@ 2026-06-11 14:07 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-06-11 14:07 UTC (permalink / raw)
To: Richard Fitzgerald; +Cc: linux-sound, linux-kernel, patches
On Thu, 11 Jun 2026 14:22:21 +0100, Richard Fitzgerald wrote:
> ASoC: cs35l56: Fix possible uninitialized value in cs35l56_spi_system_reset()
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.2
Thanks!
[1/1] ASoC: cs35l56: Fix possible uninitialized value in cs35l56_spi_system_reset()
https://git.kernel.org/broonie/sound/c/007699d278a6
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-11 18:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-11 13:22 [PATCH] ASoC: cs35l56: Fix possible uninitialized value in cs35l56_spi_system_reset() Richard Fitzgerald
2026-06-11 14:07 ` Mark Brown
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®