[PATCH 4/5] ASoC: sun8i-codec: fix bus clock leak in runtime resume error path
From: shao.mingyin
Date: Sat Nov 07 2026 - 03:12:34 EST
From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
sun8i_codec_runtime_resume() enables the bus clock and then calls
regcache_sync(). If the sync fails, it returns without disabling the
clock, so a failed resume leaves the bus clock enabled and its enable
count unbalanced.
Disable the clock before returning on the error path, as
sun4i_i2s_runtime_resume() already does for the same failure.
Fixes: 36c684936fae ("ASoC: Add sun8i digital audio codec")
Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
---
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c
index 2e4a205e4e56..e7d5c81ae1ef 100644
--- a/sound/soc/sunxi/sun8i-codec.c
+++ b/sound/soc/sunxi/sun8i-codec.c
@@ -259,6 +259,7 @@ static int sun8i_codec_runtime_resume(struct device *dev)
ret = regcache_sync(scodec->regmap);
if (ret) {
dev_err(dev, "Failed to sync regmap cache\n");
+ clk_disable_unprepare(scodec->clk_bus);
return ret;
}