ACPI / CPPC: set an error code on probe error path
We should return -EINVAL (instead of 0) if get_cpu_device() fails.
Fixes: 158c998ea4
(ACPI / CPPC: add sysfs support to compute delivered performance)
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
e5517c2a5a
commit
501634759d
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue