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: 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>
This commit is contained in:
parent
1dcbdd9448
commit
e4062765bc
|
@ -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