media: exynos4-is: Fix PM disable depth imbalance in fimc_is_probe
authorMiaoqian Lin <linmq006@gmail.com>
Mon, 7 Mar 2022 07:52:06 +0000 (08:52 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 07:13:46 +0000 (09:13 +0200)
If probe fails then we need to call pm_runtime_disable() to balance
out the previous pm_runtime_enable() call.

Fixes: 9a761e436843 ("[media] exynos4-is: Add Exynos4x12 FIMC-IS driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/samsung/exynos4-is/fimc-is.c

index e55e411038f48f72b159dbb0e3bd38e0a6260b5e..81b290dace3abe1fdea6e98cc1604a69c7e65cad 100644 (file)
@@ -830,7 +830,7 @@ static int fimc_is_probe(struct platform_device *pdev)
 
        ret = pm_runtime_resume_and_get(dev);
        if (ret < 0)
-               goto err_irq;
+               goto err_pm_disable;
 
        vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
 
@@ -864,6 +864,8 @@ err_pm:
        pm_runtime_put_noidle(dev);
        if (!pm_runtime_enabled(dev))
                fimc_is_runtime_suspend(dev);
+err_pm_disable:
+       pm_runtime_disable(dev);
 err_irq:
        free_irq(is->irq, is);
 err_clk: