提交 4829a6c1 编写于 作者: Q Qinglang Miao 提交者: Zheng Zengkai

cpufreq: mediatek: add missing platform_driver_unregister() on error in mtk_cpufreq_driver_init

stable inclusion
from stable-v5.10.121
commit c7b0ec974457b609aa35f11f8e2125c8a7b9ee05
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

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

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

[ Upstream commit 2f05c19d ]

Add the missing platform_driver_unregister() before return from
mtk_cpufreq_driver_init in the error handling case when failed
to register mtk-cpufreq platform device
Signed-off-by: NQinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 100e39fd
......@@ -573,6 +573,7 @@ static int __init mtk_cpufreq_driver_init(void)
pdev = platform_device_register_simple("mtk-cpufreq", -1, NULL, 0);
if (IS_ERR(pdev)) {
pr_err("failed to register mtk-cpufreq platform device\n");
platform_driver_unregister(&mtk_cpufreq_platdrv);
return PTR_ERR(pdev);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册