diff options
author | Yongzhi Liu <lyz_cs@pku.edu.cn> | 2022-01-16 08:34:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-03-08 21:04:06 +0300 |
commit | f67ae583a11c04e594a543042182bd3782b70c77 (patch) | |
tree | 9aebbf00a38926f2a785dc4e8ed80be99fe96063 | |
parent | 2fe0e281f7ad0a62259649764228227dd6b2561d (diff) | |
download | linux-f67ae583a11c04e594a543042182bd3782b70c77.tar.xz |
dmaengine: shdma: Fix runtime PM imbalance on error
[ Upstream commit 455896c53d5b803733ddd84e1bf8a430644439b6 ]
pm_runtime_get_() increments the runtime PM usage counter even
when it returns an error code, thus a matching decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
Link: https://lore.kernel.org/r/1642311296-87020-1-git-send-email-lyz_cs@pku.edu.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/dma/sh/shdma-base.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c index 6b5626e299b2..419c841aef34 100644 --- a/drivers/dma/sh/shdma-base.c +++ b/drivers/dma/sh/shdma-base.c @@ -118,8 +118,10 @@ static dma_cookie_t shdma_tx_submit(struct dma_async_tx_descriptor *tx) ret = pm_runtime_get(schan->dev); spin_unlock_irq(&schan->chan_lock); - if (ret < 0) + if (ret < 0) { dev_err(schan->dev, "%s(): GET = %d\n", __func__, ret); + pm_runtime_put(schan->dev); + } pm_runtime_barrier(schan->dev); |