[PATCH 15/20] ASoC: wm8985: Unwind supplies on cache replay failure
From: Pengpeng Hou
Date: Fri Aug 28 2026 - 07:41:24 EST
wm8985_set_bias_level() enables supplies and ignores regcache_sync(),
then performs the anti-pop and bias power-up sequence.
Return the cache error and disable the supplies acquired for the failed
OFF-to-STANDBY transition.
The issue was identified via static analysis and manually reviewed.
Fixes: 6d6f8b832705 ("ASoC: WM8985: Initial driver")
Assisted-by: LLM
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
sound/soc/codecs/wm8985.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c
index 2a64d5a851da..10658d9a42d0 100644
--- a/sound/soc/codecs/wm8985.c
+++ b/sound/soc/codecs/wm8985.c
@@ -971,7 +971,12 @@ static int wm8985_set_bias_level(struct snd_soc_component *component,
return ret;
}
- regcache_sync(wm8985->regmap);
+ ret = regcache_sync(wm8985->regmap);
+ if (ret) {
+ regulator_bulk_disable(ARRAY_SIZE(wm8985->supplies),
+ wm8985->supplies);
+ return ret;
+ }
/* enable anti-pop features */
snd_soc_component_update_bits(component, WM8985_OUT4_TO_ADC,
--
2.43.0