提交 be8a1c42 编写于 作者: C Christophe JAILLET 提交者: sanglipeng

PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe()

stable inclusion
from stable-v5.10.166
commit b18490138dc69ed83c5cfcdad8789004e67fee8d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b18490138dc69ed83c5cfcdad8789004e67fee8d

--------------------------------

[ Upstream commit 6049aae5 ]

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: bf6910ab ("power: avs: Add support for CPR (Core Power Reduction)")
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: NBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/0f520597dbad89ab99c217c8986912fa53eaf5f9.1671293108.git.christophe.jaillet@wanadoo.frSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 d4018db8
...@@ -1743,12 +1743,16 @@ static int cpr_probe(struct platform_device *pdev) ...@@ -1743,12 +1743,16 @@ static int cpr_probe(struct platform_device *pdev)
ret = of_genpd_add_provider_simple(dev->of_node, &drv->pd); ret = of_genpd_add_provider_simple(dev->of_node, &drv->pd);
if (ret) if (ret)
return ret; goto err_remove_genpd;
platform_set_drvdata(pdev, drv); platform_set_drvdata(pdev, drv);
cpr_debugfs_init(drv); cpr_debugfs_init(drv);
return 0; return 0;
err_remove_genpd:
pm_genpd_remove(&drv->pd);
return ret;
} }
static int cpr_remove(struct platform_device *pdev) static int cpr_remove(struct platform_device *pdev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册