media: bdisp: Fix runtime PM imbalance on error
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 21 May 2020 10:00:21 +0000 (12:00 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 27 Sep 2020 08:50:16 +0000 (10:50 +0200)
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/sti/bdisp/bdisp-v4l2.c

index 7d50d6c..060ca85 100644 (file)
@@ -1367,7 +1367,7 @@ static int bdisp_probe(struct platform_device *pdev)
        ret = pm_runtime_get_sync(dev);
        if (ret < 0) {
                dev_err(dev, "failed to set PM\n");
-               goto err_dbg;
+               goto err_pm;
        }
 
        /* Filters */
@@ -1395,7 +1395,6 @@ err_filter:
        bdisp_hw_free_filters(bdisp->dev);
 err_pm:
        pm_runtime_put(dev);
-err_dbg:
        bdisp_debugfs_remove(bdisp);
        v4l2_device_unregister(&bdisp->v4l2_dev);
 err_clk: