Skip to content

Commit 6049aae

Browse files
tititiou36andersson
authored andcommitted
PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe()
If an error occurs after a successful pm_genpd_init() call, it should be undone by a corresponding pm_genpd_remove(). Add the missing call in the error handling path, as already done in the remove function. Fixes: bf6910a ("power: avs: Add support for CPR (Core Power Reduction)") Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/0f520597dbad89ab99c217c8986912fa53eaf5f9.1671293108.git.christophe.jaillet@wanadoo.fr
1 parent 599d41f commit 6049aae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/soc/qcom/cpr.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1708,12 +1708,16 @@ static int cpr_probe(struct platform_device *pdev)
17081708

17091709
ret = of_genpd_add_provider_simple(dev->of_node, &drv->pd);
17101710
if (ret)
1711-
return ret;
1711+
goto err_remove_genpd;
17121712

17131713
platform_set_drvdata(pdev, drv);
17141714
cpr_debugfs_init(drv);
17151715

17161716
return 0;
1717+
1718+
err_remove_genpd:
1719+
pm_genpd_remove(&drv->pd);
1720+
return ret;
17171721
}
17181722

17191723
static int cpr_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)