dmaengine: stm32-dmamux: Fix PM usage counter unbalance in stm32 dmamux ops
authorZhang Qilong <zhangqilong3@huawei.com>
Mon, 7 Jun 2021 06:46:39 +0000 (14:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Aug 2021 11:22:04 +0000 (13:22 +0200)
commit281514da66a4ce121bd071240ce7c5aa4e9f6bdf
treed9b6b39ad30eb0ffd8a921cc61b35b229ab30a18
parentbbce3c99f6226b2aafe21ce29b3cb186ae9ade29
dmaengine: stm32-dmamux: Fix PM usage counter unbalance in stm32 dmamux ops

[ Upstream commit baa16371c9525f24d508508e4d296c031e1de29c ]

pm_runtime_get_sync will increment pm usage counter
even it failed. Forgetting to putting operation will
result in reference leak here. We fix it by replacing
it with pm_runtime_resume_and_get to keep usage counter
balanced.

Fixes: 4f3ceca254e0f ("dmaengine: stm32-dmamux: Add PM Runtime support")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20210607064640.121394-3-zhangqilong3@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/stm32-dmamux.c