提交 50163475 编写于 作者: D Dan Carpenter 提交者: Rafael J. Wysocki

ACPI / CPPC: set an error code on probe error path

We should return -EINVAL (instead of 0) if get_cpu_device() fails.

Fixes: 158c998e (ACPI / CPPC: add sysfs support to compute delivered performance)
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 e5517c2a
......@@ -784,8 +784,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
/* Add per logical CPU nodes for reading its feedback counters. */
cpu_dev = get_cpu_device(pr->id);
if (!cpu_dev)
if (!cpu_dev) {
ret = -EINVAL;
goto out_free;
}
ret = kobject_init_and_add(&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj,
"acpi_cppc");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册