[PATCH 12/20] ASoC: wm8770: Unwind supplies on cache replay failure
From: Pengpeng Hou
Date: Fri Aug 28 2026 - 07:41:43 EST
wm8770_set_bias_level() enables supplies and then ignores
regcache_sync() during the OFF-to-STANDBY transition. It continues with
global power-up after an incomplete restore.
Return the cache error and disable the supplies acquired for the failed
transition.
The issue was identified via static analysis and manually reviewed.
Fixes: c046fd4dd613 ("ASoC: WM8770: Initial driver")
Assisted-by: LLM
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
sound/soc/codecs/wm8770.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8770.c b/sound/soc/codecs/wm8770.c
index b8b4d1e823e6..5bcad0729ece 100644
--- a/sound/soc/codecs/wm8770.c
+++ b/sound/soc/codecs/wm8770.c
@@ -517,7 +517,12 @@ static int wm8770_set_bias_level(struct snd_soc_component *component,
return ret;
}
- regcache_sync(wm8770->regmap);
+ ret = regcache_sync(wm8770->regmap);
+ if (ret) {
+ regulator_bulk_disable(ARRAY_SIZE(wm8770->supplies),
+ wm8770->supplies);
+ return ret;
+ }
/* global powerup */
snd_soc_component_write(component, WM8770_PWDNCTRL, 0);
--
2.43.0