diff mbox series

dmaengine: dw-axi-dmac: Fix runtime PM imbalance on error

Message ID 20200522053154.5951-1-dinghao.liu@zju.edu.cn (mailing list archive)
State Not Applicable
Headers show
Series dmaengine: dw-axi-dmac: Fix runtime PM imbalance on error | expand

Commit Message

Dinghao Liu May 22, 2020, 5:31 a.m. UTC
When axi_dma_resume() returns an error code, a pairing
runtime PM usage counter decrement is needed to keep the
counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index 14c1ac26f866..a368d01170f1 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -924,8 +924,10 @@  static int dw_probe(struct platform_device *pdev)
 	 */
 	pm_runtime_get_noresume(chip->dev);
 	ret = axi_dma_resume(chip);
-	if (ret < 0)
+	if (ret < 0) {
+		pm_runtime_put(chip->dev);
 		goto err_pm_disable;
+	}
 
 	axi_dma_hw_init(chip);