1 |
From 91b65a7dabe42860a2846ae62a8bea97ca9ca837 Mon Sep 17 00:00:00 2001 |
2 |
From: Dou Liyang <douly.fnst@cn.fujitsu.com> |
3 |
Date: Fri, 24 Aug 2018 10:51:26 +0800 |
4 |
Subject: [PATCH 035/145] ACPI / processor: Fix the return value of |
5 |
acpi_processor_ids_walk() |
6 |
|
7 |
[ Upstream commit d0381bf4f80c571dde1244fe5b85dc35e8b3f546 ] |
8 |
|
9 |
ACPI driver should make sure all the processor IDs in their ACPI Namespace |
10 |
are unique. the driver performs a depth-first walk of the namespace tree |
11 |
and calls the acpi_processor_ids_walk() to check the duplicate IDs. |
12 |
|
13 |
But, the acpi_processor_ids_walk() mistakes the return value. If a |
14 |
processor is checked, it returns true which causes the walk break |
15 |
immediately, and other processors will never be checked. |
16 |
|
17 |
Repace the value with AE_OK which is the standard acpi_status value. |
18 |
And don't abort the namespace walk even on error. |
19 |
|
20 |
Fixes: 8c8cb30f49b8 (acpi/processor: Implement DEVICE operator for processor enumeration) |
21 |
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com> |
22 |
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
23 |
Signed-off-by: Sasha Levin <sashal@kernel.org> |
24 |
--- |
25 |
drivers/acpi/acpi_processor.c | 7 ++++--- |
26 |
1 file changed, 4 insertions(+), 3 deletions(-) |
27 |
|
28 |
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c |
29 |
index 449d86d39965..fc447410ae4d 100644 |
30 |
--- a/drivers/acpi/acpi_processor.c |
31 |
+++ b/drivers/acpi/acpi_processor.c |
32 |
@@ -643,7 +643,7 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle, |
33 |
|
34 |
status = acpi_get_type(handle, &acpi_type); |
35 |
if (ACPI_FAILURE(status)) |
36 |
- return false; |
37 |
+ return status; |
38 |
|
39 |
switch (acpi_type) { |
40 |
case ACPI_TYPE_PROCESSOR: |
41 |
@@ -663,11 +663,12 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle, |
42 |
} |
43 |
|
44 |
processor_validated_ids_update(uid); |
45 |
- return true; |
46 |
+ return AE_OK; |
47 |
|
48 |
err: |
49 |
+ /* Exit on error, but don't abort the namespace walk */ |
50 |
acpi_handle_info(handle, "Invalid processor object\n"); |
51 |
- return false; |
52 |
+ return AE_OK; |
53 |
|
54 |
} |
55 |
|
56 |
-- |
57 |
2.19.1 |
58 |
|