Skip to content

Commit fadf231

Browse files
jic23ctmarinas
authored andcommitted
ACPI: processor: Return an error if acpi_processor_get_info() fails in processor_add()
Rafael observed [1] that returning 0 from processor_add() will result in acpi_default_enumeration() being called which will attempt to create a platform device, but that makes little sense when the processor is known to be not available. So just return the error code from acpi_processor_get_info() instead. Link: https://lore.kernel.org/all/CAJZ5v0iKU8ra9jR+EmgxbuNm=Uwx2m1-8vn_RAZ+aCiUVLe3Pw@mail.gmail.com/ [1] Suggested-by: Rafael J. Wysocki <rafael@kernel.org> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Gavin Shan <gshan@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20240529133446.28446-5-Jonathan.Cameron@huawei.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 157080f commit fadf231

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/acpi/acpi_processor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ static int acpi_processor_add(struct acpi_device *device,
393393

394394
result = acpi_processor_get_info(device);
395395
if (result) /* Processor is not physically present or unavailable */
396-
return 0;
396+
return result;
397397

398398
BUG_ON(pr->id >= nr_cpu_ids);
399399

0 commit comments

Comments
 (0)