On Sat Mar 28 15:14:52 2026 +0000, David Carlier wrote:
> When mali_c55_media_frameworks_init() fails, the goto target jumps to
> err_free_context_registers, skipping pm_runtime_disable() despite
> pm_runtime having already been enabled earlier in the function.
> 
> Fix this by adding an err_pm_runtime_disable label and redirecting the
> frameworks init failure to it, so pm_runtime is properly unwound on
> that error path. The runtime PM status is also set back to suspended
> before disabling, to undo the pm_runtime_set_active() from probe.
> 
> Cc: [email protected]
> Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver")
> Signed-off-by: David Carlier <[email protected]>
> Reviewed-by: Jacopo Mondi <[email protected]>
> Signed-off-by: Jacopo Mondi <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/platform/arm/mali-c55/mali-c55-core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

---

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 00aed62c63d9..ee4a4267415e 100644
--- a/drivers/media/platform/arm/mali-c55/mali-c55-core.c
+++ b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
@@ -828,7 +828,7 @@ static int mali_c55_probe(struct platform_device *pdev)
 
        ret = mali_c55_media_frameworks_init(mali_c55);
        if (ret)
-               goto err_free_context_registers;
+               goto err_pm_runtime_disable;
 
        pm_runtime_idle(&pdev->dev);
 
@@ -842,8 +842,9 @@ static int mali_c55_probe(struct platform_device *pdev)
 
 err_deinit_media_frameworks:
        mali_c55_media_frameworks_deinit(mali_c55);
+err_pm_runtime_disable:
+       pm_runtime_set_suspended(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
-err_free_context_registers:
        kfree(mali_c55->context.registers);
 err_power_off:
        __mali_c55_power_off(mali_c55);
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to