* [PATCH] dma: ti: edma: Fix PM reference leak on probe failure
@ 2026-01-11 17:33 Kery Qi
0 siblings, 0 replies; only message in thread
From: Kery Qi @ 2026-01-11 17:33 UTC (permalink / raw)
To: peter.ujfalusi; +Cc: vkoul, dmaengine, Kery Qi
The PM reference count is not expected to be incremented on
return in functions edma_probe.
However, pm_runtime_get_sync will increment pm usage counter
even failed. Forgetting to putting operation will result in a
reference leak here.
Replace it with pm_runtime_resume_and_get to keep usage
counter balanced, since the failure path returns without a
matching pm_runtime_put_noidle().
Fixes: 2a03c1314506 ("dmaengine: ti: edma: add missed operations")
Signed-off-by: Kery Qi <qikeyu2017@gmail.com>
---
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 552be71db6c4..93171b473151 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.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-11 17:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-11 17:33 [PATCH] dma: ti: edma: Fix PM reference leak on probe failure Kery Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox