Commit 7a5b9e03 authored by Zhang Qilong's avatar Zhang Qilong Committed by Zheng Zengkai
Browse files

dmaengine: stm32-dma: Fix PM usage counter imbalance in stm32 dma ops

stable inclusion
from stable-5.10.58
commit bbce3c99f6226b2aafe21ce29b3cb186ae9ade29
bugzilla: 176984 https://gitee.com/openeuler/kernel/issues/I4E2P4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bbce3c99f6226b2aafe21ce29b3cb186ae9ade29



--------------------------------

[ Upstream commit d54db74a ]

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: 48bc73ba ("dmaengine: stm32-dma: Add PM Runtime support")
Fixes: 05f8740a ("dmaengine: stm32-dma: add suspend/resume power management support")
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20210607064640.121394-2-zhangqilong3@huawei.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 20e0c7c8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment