Commit e4062765 authored by Zhang Qilong's avatar Zhang Qilong Committed by Mark Brown

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: e7d973a3 ("spi: sprd: Add SPI driver for Spreadtrum SC9860")
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Acked-by: default avatarChunyan Zhang <zhang.lyra@gmail.com>
Link: https://lore.kernel.org/r/20201106015035.139574-1-zhangqilong3@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1dcbdd94
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment