]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ACPI / processor: Fix the return value of acpi_processor_ids_walk()
authorDou Liyang <douly.fnst@cn.fujitsu.com>
Fri, 24 Aug 2018 02:51:26 +0000 (10:51 +0800)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:56:33 +0000 (19:56 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836802
[ Upstream commit d0381bf4f80c571dde1244fe5b85dc35e8b3f546 ]

ACPI driver should make sure all the processor IDs in their ACPI Namespace
are unique. the driver performs a depth-first walk of the namespace tree
and calls the acpi_processor_ids_walk() to check the duplicate IDs.

But, the acpi_processor_ids_walk() mistakes the return value. If a
processor is checked, it returns true which causes the walk break
immediately, and other processors will never be checked.

Repace the value with AE_OK which is the standard acpi_status value.
And don't abort the namespace walk even on error.

Fixes: 8c8cb30f49b8 (acpi/processor: Implement DEVICE operator for processor enumeration)
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/acpi/acpi_processor.c

index 449d86d39965e6090a518eab4f9c18aa9f2f6852..fc447410ae4d17709adc0e1c56aba6ff7e02f633 100644 (file)
@@ -643,7 +643,7 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle,
 
        status = acpi_get_type(handle, &acpi_type);
        if (ACPI_FAILURE(status))
-               return false;
+               return status;
 
        switch (acpi_type) {
        case ACPI_TYPE_PROCESSOR:
@@ -663,11 +663,12 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle,
        }
 
        processor_validated_ids_update(uid);
-       return true;
+       return AE_OK;
 
 err:
+       /* Exit on error, but don't abort the namespace walk */
        acpi_handle_info(handle, "Invalid processor object\n");
-       return false;
+       return AE_OK;
 
 }