diff mbox series

[-next] spi: qup: fix PM reference leak in spi_qup_remove()

Message ID 20210409095458.29921-1-wangli74@huawei.com
State Accepted
Commit cec77e0a249892ceb10061bf17b63f9fb111d870
Headers show
Series [-next] spi: qup: fix PM reference leak in spi_qup_remove() | expand

Commit Message

Wang Li April 9, 2021, 9:54 a.m. UTC
pm_runtime_get_sync will increment pm usage counter even it failed.
Forgetting to putting operation will result in reference leak here.
Fix it by replacing it with pm_runtime_resume_and_get to keep usage
counter balanced.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Li <wangli74@huawei.com>
---
 drivers/spi/spi-qup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+linux-arm-msm@kernel.org May 26, 2021, 7:03 p.m. UTC | #1
Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

On Fri, 9 Apr 2021 09:54:58 +0000 you wrote:
> pm_runtime_get_sync will increment pm usage counter even it failed.

> Forgetting to putting operation will result in reference leak here.

> Fix it by replacing it with pm_runtime_resume_and_get to keep usage

> counter balanced.

> 

> Reported-by: Hulk Robot <hulkci@huawei.com>

> Signed-off-by: Wang Li <wangli74@huawei.com>

> 

> [...]


Here is the summary with links:
  - [-next] spi: qup: fix PM reference leak in spi_qup_remove()
    https://git.kernel.org/qcom/c/cec77e0a2498

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index 8dcb2e70735c..d39dec6d1c91 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -1263,7 +1263,7 @@  static int spi_qup_remove(struct platform_device *pdev)
 	struct spi_qup *controller = spi_master_get_devdata(master);
 	int ret;
 
-	ret = pm_runtime_get_sync(&pdev->dev);
+	ret = pm_runtime_resume_and_get(&pdev->dev);
 	if (ret < 0)
 		return ret;