* [PATCH] dmaengine: rcar-dmac: handle pm_runtime_get_sync failure
@ 2020-06-04 20:34 Navid Emamdoost
0 siblings, 0 replies; only message in thread
From: Navid Emamdoost @ 2020-06-04 20:34 UTC (permalink / raw)
To: Vinod Koul, Dan Williams, Geert Uytterhoeven, Yoshihiro Shimoda,
Simon Horman, Stephen Boyd, Navid Emamdoost, Colin Ian King,
dmaengine, linux-kernel
Cc: emamd001, wu000273, kjlu, smccaman
Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count. Call pm_runtime_put if
pm_runtime_get_sync fails.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
drivers/dma/sh/rcar-dmac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 59b36ab5d684..dd7ca67c93ed 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1879,6 +1879,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0) {
dev_err(&pdev->dev, "runtime PM get sync failed (%d)\n", ret);
+ pm_runtime_put(&pdev->dev);
return ret;
}
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-06-04 20:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 20:34 [PATCH] dmaengine: rcar-dmac: handle pm_runtime_get_sync failure Navid Emamdoost
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).