public inbox for dmaengine@vger.kernel.org
 help / color / mirror / Atom feed
From: Kery Qi <qikeyu2017@gmail.com>
To: peter.ujfalusi@gmail.com
Cc: vkoul@kernel.org, dmaengine@vger.kernel.org,
	Kery Qi <qikeyu2017@gmail.com>
Subject: [PATCH] dma: ti: edma: Fix PM reference leak on probe failure
Date: Mon, 12 Jan 2026 01:33:49 +0800	[thread overview]
Message-ID: <20260111173348.2218-2-qikeyu2017@gmail.com> (raw)

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


                 reply	other threads:[~2026-01-11 17:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260111173348.2218-2-qikeyu2017@gmail.com \
    --to=qikeyu2017@gmail.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=peter.ujfalusi@gmail.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox