In __mali_c55_power_on(), if clk_bulk_prepare_enable() succeeds but
reset_control_bulk_deassert() fails, the function returns the error
directly without disabling the clocks. This leaves the clocks enabled
permanently in the runtime resume path, or leaks them in the probe
path.
Fix this by calling clk_bulk_disable_unprepare() before returning the
error.
Signed-off-by: Chen Changcheng <chenchangcheng@kylinos.cn>
---
drivers/media/platform/arm/mali-c55/mali-c55-core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-core.c b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
index 94a389b3f833..f28e9f4354ac 100644
--- a/drivers/media/platform/arm/mali-c55/mali-c55-core.c
+++ b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
@@ -698,6 +698,8 @@ static int __mali_c55_power_on(struct mali_c55 *mali_c55)
mali_c55->resets);
if (ret) {
dev_err(mali_c55->dev, "failed to deassert resets\n");
+ clk_bulk_disable_unprepare(ARRAY_SIZE(mali_c55->clks),
+ mali_c55->clks);
return ret;
}
--
2.25.1