Skip to contentSkip to conversation

dmaengine: rcar-dmac: handle pm_runtime_get_sync failure

PATCH New Navid Emamdoost 1 participant 1 message Jun 4, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/dma/sh/rcar-dmac.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/sh/rcar-dmac.c +1 -0
index 59b36ab5d684..dd7ca67c93ed 100644
@@ -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;
 	}
 
Signature · 1 line
2.17.1