linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe
@ 2020-05-23 11:54 Dinghao Liu
  2020-06-08  1:54 ` Laurent Pinchart
  0 siblings, 1 reply; 8+ messages in thread
From: Dinghao Liu @ 2020-05-23 11:54 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Laurent Pinchart, Kieran Bingham, Mauro Carvalho Chehab,
	linux-media, linux-renesas-soc, linux-kernel

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>
---
 drivers/media/platform/vsp1/vsp1_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
index c650e45bb0ad..017a54f2fdd8 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -846,8 +846,10 @@ static int vsp1_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 
 	ret = pm_runtime_get_sync(&pdev->dev);
-	if (ret < 0)
+	if (ret < 0) {
+		pm_runtime_put_sync(&pdev->dev);
 		goto done;
+	}
 
 	vsp1->version = vsp1_read(vsp1, VI6_IP_VERSION);
 	pm_runtime_put_sync(&pdev->dev);
-- 
2.17.1


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

end of thread, other threads:[~2020-06-08 11:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-23 11:54 [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe Dinghao Liu
2020-06-08  1:54 ` Laurent Pinchart
2020-06-08  1:57   ` Laurent Pinchart
2020-06-08  3:03     ` dinghao.liu
2020-06-08  3:11       ` Laurent Pinchart
2020-06-08  3:33         ` dinghao.liu
2020-06-08  7:39       ` Geert Uytterhoeven
2020-06-08 11:54         ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).