Skip to content

Commit

Permalink
ACPI / CPPC: set an error code on probe error path
Browse files Browse the repository at this point in the history
We should return -EINVAL (instead of 0) if get_cpu_device() fails.

Fixes: 158c998 (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>
  • Loading branch information
Dan Carpenter authored and Rafael J. Wysocki committed Nov 30, 2016
1 parent e5517c2 commit 5016347
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/acpi/cppc_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 5016347

Please sign in to comment.