dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: tegra210-adma: Fix runtime PM imbalance on error
@ 2020-05-22  7:58 Dinghao Liu
  2020-05-22 10:43 ` Jon Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Dinghao Liu @ 2020-05-22  7:58 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Laxman Dewangan, Jon Hunter, Vinod Koul, Dan Williams,
	Thierry Reding, dmaengine, linux-tegra, linux-kernel

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/dma/tegra210-adma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index c4ce5dfb149b..803e1f4d5dac 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -658,6 +658,7 @@ static int tegra_adma_alloc_chan_resources(struct dma_chan *dc)
 
 	ret = pm_runtime_get_sync(tdc2dev(tdc));
 	if (ret < 0) {
+		pm_runtime_put_sync(tdc2dev(tdc));
 		free_irq(tdc->irq, tdc);
 		return ret;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-22 11:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22  7:58 [PATCH] dmaengine: tegra210-adma: Fix runtime PM imbalance on error Dinghao Liu
2020-05-22 10:43 ` Jon Hunter
2020-05-22 10:57   ` dinghao.liu
2020-05-22 11:27     ` Jon Hunter
2020-05-22 11:32       ` dinghao.liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).