Re: [PATCH] media: mali-c55: fix clock leak when reset deassert fails

From: Jacopo Mondi

Date: Mon Jul 27 2026 - 06:56:58 EST


Hi Chen

On Fri, Jul 24, 2026 at 10:53:45AM +0800, Chen Changcheng wrote:
> 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@xxxxxxxxxx>

The issue has already been fixed by:
https://patchwork.linuxtv.org/project/linux-media/patch/20260703163503.715606-1-devnexen@xxxxxxxxx/

> ---
> 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
>
>