Skip to content

Commit 1da569f

Browse files
YuKuai-huaweivinodkoul
authored andcommitted
dmaengine: usb-dmac: Fix PM reference leak in usb_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 moving the error_pm label above the pm_runtime_put() in the error path. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 7dd2dd4 commit 1da569f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/dma/sh/usb-dmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,8 @@ static int usb_dmac_probe(struct platform_device *pdev)
855855

856856
error:
857857
of_dma_controller_free(pdev->dev.of_node);
858-
pm_runtime_put(&pdev->dev);
859858
error_pm:
859+
pm_runtime_put(&pdev->dev);
860860
pm_runtime_disable(&pdev->dev);
861861
return ret;
862862
}

0 commit comments

Comments
 (0)