summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Qilong <zhangqilong3@huawei.com>2020-11-06 02:50:35 +0100
committerMark Brown <broonie@kernel.org>2020-11-11 13:39:32 +0100
commite4062765bc2a41e025e29dd56bad798505036427 (patch)
tree536f132c3b7c0adef4229017f580a029130d463b
parentspi: imx: fix reference leak in two imx operations (diff)
downloadlinux-e4062765bc2a41e025e29dd56bad798505036427.tar.xz
linux-e4062765bc2a41e025e29dd56bad798505036427.zip
spi: sprd: fix reference leak in sprd_spi_remove
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in sprd_spi_remove, so we should fix it. Fixes: e7d973a31c24b ("spi: sprd: Add SPI driver for Spreadtrum SC9860") Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Acked-by: Chunyan Zhang <zhang.lyra@gmail.com> Link: https://lore.kernel.org/r/20201106015035.139574-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-sprd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c
index 635738f54c73..b41a75749b49 100644
--- a/drivers/spi/spi-sprd.c
+++ b/drivers/spi/spi-sprd.c
@@ -1010,6 +1010,7 @@ static int sprd_spi_remove(struct platform_device *pdev)
ret = pm_runtime_get_sync(ss->dev);
if (ret < 0) {
+ pm_runtime_put_noidle(ss->dev);
dev_err(ss->dev, "failed to resume SPI controller\n");
return ret;
}