spi: stm32: fix reference leak in stm32_spi_resume
authorZhang Qilong <zhangqilong3@huawei.com>
Fri, 6 Nov 2020 01:52:17 +0000 (09:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:03 +0000 (11:53 +0100)
commit26a19bbe6003b667da63f609307473df6b52d343
treef534d50884e58eff20e169dae682749c0970c792
parent615bc1ba5b87843f932ea729b6c3304f58faf7bb
spi: stm32: fix reference leak in stm32_spi_resume

[ Upstream commit 900ccdcb79bb61471df1566a70b2b39687a628d5 ]

pm_runtime_get_sync will increment pm usage counter even it
failed. Forgetting to pm_runtime_put_noidle will result in
reference leak in stm32_spi_resume, so we should fix it.

Fixes: db96bf976a4fc ("spi: stm32: fixes suspend/resume management")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Alain Volmat <alain.volmat@st.com>
Link: https://lore.kernel.org/r/20201106015217.140476-1-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-stm32.c