diff mbox series

dmaengine: stm32: Fix rumtime PM imbalance in stm32_dmamux_resume

Message ID 20210407053402.3750-1-dinghao.liu@zju.edu.cn (mailing list archive)
State New, archived
Headers show
Series dmaengine: stm32: Fix rumtime PM imbalance in stm32_dmamux_resume | expand

Commit Message

Dinghao Liu April 7, 2021, 5:34 a.m. UTC
pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/dma/stm32-dmamux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c
index ef0d0555103d..f9258a63b9c3 100644
--- a/drivers/dma/stm32-dmamux.c
+++ b/drivers/dma/stm32-dmamux.c
@@ -361,7 +361,7 @@  static int stm32_dmamux_resume(struct device *dev)
 	if (ret < 0)
 		return ret;
 
-	ret = pm_runtime_get_sync(dev);
+	ret = pm_runtime_resume_and_get(dev);
 	if (ret < 0)
 		return ret;