[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200604203432.12082-1-navid.emamdoost@gmail.com>
Date: Thu, 4 Jun 2020 15:34:30 -0500
From: Navid Emamdoost <navid.emamdoost@...il.com>
To: Vinod Koul <vkoul@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Simon Horman <horms+renesas@...ge.net.au>,
Stephen Boyd <swboyd@...omium.org>,
Navid Emamdoost <navid.emamdoost@...il.com>,
Colin Ian King <colin.king@...onical.com>,
dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: emamd001@....edu, wu000273@....edu, kjlu@....edu, smccaman@....edu
Subject: [PATCH] dmaengine: rcar-dmac: handle pm_runtime_get_sync failure
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@...il.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
Powered by blists - more mailing lists