[PATCH v2 1/2] dmaengine: ti: edma: fix pm_runtime usage counter leak on error

From: phucduc . bui

Date: Wed Sep 23 2026 - 03:27:30 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

pm_runtime_get_sync() leaves the runtime PM usage counter incremented even
when it fails, but the error path in edma_probe() does not call
pm_runtime_put_noidle() to balance it, leaking a reference each time
resume fails.

Use pm_runtime_resume_and_get() instead, which automatically drops the
usage counter on failure, fixing the leak.

Fixes: 2a03c1314506 ("dmaengine: ti: edma: add missed operations")
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---

Changes in v2:
- Update the commit message: Change the function name from netcp_probe()
to edma_probe().

drivers/dma/ti/edma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
index d97db5af3555..8be9e71dab76 100644
--- a/drivers/dma/ti/edma.c
+++ b/drivers/dma/ti/edma.c
@@ -2345,9 +2345,9 @@ static int edma_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ecc);

pm_runtime_enable(dev);
- ret = pm_runtime_get_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
- dev_err(dev, "pm_runtime_get_sync() failed\n");
+ dev_err(dev, "pm_runtime_resume_and_get() failed\n");
pm_runtime_disable(dev);
return ret;
}
--
2.43.0