summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-stm32.c
diff options
context:
space:
mode:
authorZhang Qilong <zhangqilong3@huawei.com>2020-11-06 02:52:17 +0100
committerMark Brown <broonie@kernel.org>2020-11-06 11:54:49 +0100
commit900ccdcb79bb61471df1566a70b2b39687a628d5 (patch)
tree5ed93275163a64205dadee8f29a29d66afbd1c52 /drivers/spi/spi-stm32.c
parentspi: spi-mem: fix reference leak in spi_mem_access_start (diff)
downloadlinux-900ccdcb79bb61471df1566a70b2b39687a628d5.tar.xz
linux-900ccdcb79bb61471df1566a70b2b39687a628d5.zip
spi: stm32: fix reference leak in stm32_spi_resume
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>
Diffstat (limited to 'drivers/spi/spi-stm32.c')
-rw-r--r--drivers/spi/spi-stm32.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 2cc850eb8922..471dedf3d339 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -2062,6 +2062,7 @@ static int stm32_spi_resume(struct device *dev)
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
+ pm_runtime_put_noidle(dev);
dev_err(dev, "Unable to power device:%d\n", ret);
return ret;
}