summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpi_processor.c
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2024-05-29 16:34:31 +0300
committerCatalin Marinas <catalin.marinas@arm.com>2024-06-28 20:38:27 +0300
commitfadf231f0a06a6748a7fc4a2c29ac9ef7bca6bfd (patch)
tree43bd3513e496f48c0910def165e6be9d1eb01aea /drivers/acpi/acpi_processor.c
parent157080f03c7abb7df58c4cb519e18c188cfb7404 (diff)
downloadlinux-fadf231f0a06a6748a7fc4a2c29ac9ef7bca6bfd.tar.xz
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>
Diffstat (limited to 'drivers/acpi/acpi_processor.c')
-rw-r--r--drivers/acpi/acpi_processor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index 161c95c9d60a..5f062806ca40 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -393,7 +393,7 @@ static int acpi_processor_add(struct acpi_device *device,
result = acpi_processor_get_info(device);
if (result) /* Processor is not physically present or unavailable */
- return 0;
+ return result;
BUG_ON(pr->id >= nr_cpu_ids);