mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: bdisp: fix reference count leaks due to pm_runtime_get_sync
@ 2020-06-14  3:49 Aditya Pakki
  2020-06-14  7:10 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2020-06-14  3:49 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, wu000273, Fabien Dessenne, Mauro Carvalho Chehab,
	linux-media, linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-14  7:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-14  3:49 [PATCH] media: bdisp: fix reference count leaks due to pm_runtime_get_sync Aditya Pakki
2020-06-14  7:10 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®