Skip to content

Commit 78fa0f7

Browse files
Zou WeiSasha Levin
authored andcommitted
dmaengine: rcar-dmac: Fix PM reference leak in rcar_dmac_probe()
[ Upstream commit dea8464 ] 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: Zou Wei <zou_wei@huawei.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/1622442963-54095-1-git-send-email-zou_wei@huawei.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6a07cf3 commit 78fa0f7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/dma/sh/rcar-dmac.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)
18741874

18751875
/* Enable runtime PM and initialize the device. */
18761876
pm_runtime_enable(&pdev->dev);
1877-
ret = pm_runtime_get_sync(&pdev->dev);
1877+
ret = pm_runtime_resume_and_get(&pdev->dev);
18781878
if (ret < 0) {
18791879
dev_err(&pdev->dev, "runtime PM get sync failed (%d)\n", ret);
18801880
return ret;

0 commit comments

Comments
 (0)