dmaengine: tegra210-adma: fix pm_runtime_get_sync failure
Subsystems (3)
PATCH 1/1 dmaengine: tegra210-adma: fix pm_runtime_get_sync failure
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails.
Signed-off-by Navid Emamdoost <[email protected]>
--- drivers/dma/tegra210-adma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/tegra210-adma.c +3 -1
@@ -869,8 +869,10 @@ static int tegra_adma_probe(struct platform_device *pdev)pm_runtime_enable (&pdev->dev); ret =pm_runtime_get_sync (&pdev->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_sync (&pdev->dev); goto rpm_disable; + } ret =tegra_adma_init (tdma);if (ret)
Signature · 1 line
2.17.1
Jon Hunter
maintainerQuoted 14 lines · Navid Emamdoost
Calling
pm_runtime_get_syncincrements the counter even in case of failure, causing incorrect ref count. Callpm_runtime_putifpm_runtime_get_syncfails.Signed-off-by Navid Emamdoost <[email protected]>--- drivers/dma/tegra210-adma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/dma/tegra210-adma.c +0
-0
drivers/dma/tegra210-adma.c static int tegra_adma_probe(struct platform_device *pdev) · line 875
Quoted 8 lines
drivers/dma/tegra210-adma.c +3
-1@@ -869,8 +869,10 @@ static int tegra_adma_probe(struct platform_device *pdev)pm_runtime_enable (&pdev->dev); ret =pm_runtime_get_sync (&pdev->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_sync (&pdev->dev); goto rpm_disable; + }
I would prefer it if you did not add the pm_runtime_put_sync() call here because there is already one in the error path that can be used.
Jon
Signature · 1 line
nvpublic