Skip to content

Commit 5016347

Browse files
Dan Carpenterrafaeljw
authored andcommitted
ACPI / CPPC: set an error code on probe error path
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>
1 parent e5517c2 commit 5016347

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/acpi/cppc_acpi.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
784784

785785
/* Add per logical CPU nodes for reading its feedback counters. */
786786
cpu_dev = get_cpu_device(pr->id);
787-
if (!cpu_dev)
787+
if (!cpu_dev) {
788+
ret = -EINVAL;
788789
goto out_free;
790+
}
789791

790792
ret = kobject_init_and_add(&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj,
791793
"acpi_cppc");

0 commit comments

Comments
 (0)