lkml.org 
[lkml]   [2020]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] media: bdisp: fix reference count leaks due to pm_runtime_get_sync
Date
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 <pakki001@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
\
 
 \ /
  Last update: 2020-06-14 05:50    [W:0.064 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site