Skip to content

Commit 455896c

Browse files
hyperlyzvinodkoul
authored andcommitted
dmaengine: shdma: Fix runtime PM imbalance on error
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent da2ad87 commit 455896c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/dma/sh/shdma-base.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ static dma_cookie_t shdma_tx_submit(struct dma_async_tx_descriptor *tx)
115115
ret = pm_runtime_get(schan->dev);
116116

117117
spin_unlock_irq(&schan->chan_lock);
118-
if (ret < 0)
118+
if (ret < 0) {
119119
dev_err(schan->dev, "%s(): GET = %d\n", __func__, ret);
120+
pm_runtime_put(schan->dev);
121+
}
120122

121123
pm_runtime_barrier(schan->dev);
122124

0 commit comments

Comments
 (0)