mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
spi: sprd: fix reference leak in sprd_spi_remove
[ Upstream commite4062765bc] 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:e7d973a31c("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
82162f4bdf
commit
b14a8f29c3
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user