On calling pm_runtime_get_sync() the reference count of the device
is incremented. In case of failure, decrement the
reference count before returning the error.

Signed-off-by: Aditya Pakki <pakki...@umn.edu>
---
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c 
b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
index af2d5eb782ce..098914ca4f68 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
@@ -512,6 +512,7 @@ static int bdisp_start_streaming(struct vb2_queue *q, 
unsigned int count)
                                v4l2_m2m_buf_done(buf, VB2_BUF_STATE_QUEUED);
                }
 
+               pm_runtime_put(ctx->bdisp_dev->dev);
                return ret;
        }
 
@@ -1371,7 +1372,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 */
-- 
2.25.1

Reply via email to