dmaengine: rcar-dmac: Fix PM reference leak in rcar_dmac_probe()
Subsystems (2)
PATCH 1/1 dmaengine: rcar-dmac: Fix PM reference leak in rcar_dmac_probe()
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.
--- drivers/dma/sh/rcar-dmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/sh/rcar-dmac.c +1 -1
@@ -1913,7 +1913,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)/* Enable runtime PM and initialize the device. */ pm_runtime_enable (&pdev->dev); - ret =pm_runtime_get_sync (&pdev->dev); + ret =pm_runtime_resume_and_get (&pdev->dev);if (ret <0 ) {dev_err (&pdev->dev,"runtime PM get sync failed (%d)\n" , ret);return ret;
Signature · 1 line
2.6.2
Quoted 7 lines · Zou Wei
pm_runtime_get_syncwill increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it withpm_runtime_resume_and_getto keep usage counter balanced.Reported-by Hulk Robot <[email protected]>Signed-off-by Zou Wei <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Hi Zou,
Thank you for the patch.
Quoted 7 lines · Zou Wei
pm_runtime_get_syncwill increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it withpm_runtime_resume_and_getto keep usage counter balanced.Reported-by Hulk Robot <[email protected]>Signed-off-by Zou Wei <[email protected]>
Quoted 17 lines
--- drivers/dma/sh/rcar-dmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dma/sh/rcar-dmac.c +1
-1@@ -1913,7 +1913,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)/* Enable runtime PM and initialize the device. */ pm_runtime_enable (&pdev->dev); - ret =pm_runtime_get_sync (&pdev->dev); + ret =pm_runtime_resume_and_get (&pdev->dev);if (ret <0 ) {dev_err (&pdev->dev,"runtime PM get sync failed (%d)\n" , ret);return ret;
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 4 lines · Zou Wei
pm_runtime_get_syncwill increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it withpm_runtime_resume_and_getto keep usage counter balanced.
Applied, thanks
Signature · 1 line
~Vinod