Commit 50163475 authored by Dan Carpenter's avatar Dan Carpenter Committed by 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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment