spi: imx: fix reference leak in two imx operations
authorZhang Qilong <zhangqilong3@huawei.com>
Mon, 2 Nov 2020 14:58:35 +0000 (22:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:06 +0000 (11:53 +0100)
commit851228fd1f6782e89b02b0d4f8b25db75b8881c6
treeb2fa9b3f659290958ff7ae25ebca6398f1868c94
parentb8c65a716e8d862210394d76d492e0dc74f31ac3
spi: imx: fix reference leak in two imx operations

[ Upstream commit 1dcbdd944824369d4569959f8130336fe6fe5f39 ]

pm_runtime_get_sync will increment pm usage counter even it
failed. Forgetting to pm_runtime_put_noidle will result in
reference leak in callers(spi_imx_prepare_message and
spi_imx_remove), so we should fix it.

Fixes: 525c9e5a32bd7 ("spi: imx: enable runtime pm support")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20201102145835.4765-1-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-imx.c