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

From: Dinghao Liu
Date: Fri May 22 2020 - 01:32:14 EST


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@xxxxxxxxxx>
---
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

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);

--
2.17.1