Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: bf6910abf548 ("power: avs: Add support for CPR (Core Power Reduction)")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/0f520597dbad89ab99c217c8986912fa53eaf5f9.1671293108.git.christophe.jaillet@wanadoo.fr

authored by

Christophe JAILLET and committed by
Bjorn Andersson
6049aae5 599d41fb

+5 -1
+5 -1
drivers/soc/qcom/cpr.c
··· 1708 1708 1709 1709 ret = of_genpd_add_provider_simple(dev->of_node, &drv->pd); 1710 1710 if (ret) 1711 - return ret; 1711 + goto err_remove_genpd; 1712 1712 1713 1713 platform_set_drvdata(pdev, drv); 1714 1714 cpr_debugfs_init(drv); 1715 1715 1716 1716 return 0; 1717 + 1718 + err_remove_genpd: 1719 + pm_genpd_remove(&drv->pd); 1720 + return ret; 1717 1721 } 1718 1722 1719 1723 static int cpr_remove(struct platform_device *pdev)