diff options
author | Lv Zheng <lv.zheng@intel.com> | 2013-06-08 09:01:19 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-20 01:43:15 +0200 |
commit | 341e7ba1a9a48c50b46a1ebf305823f883c85d4f (patch) | |
tree | 1578eea7d78ac8d2e415900914fc465f0faf9c3d /drivers/acpi/acpica | |
parent | 5a9792f3be74bfad2985b3f4c7afc9e6f6a3f798 (diff) |
ACPICA: _CST repair: Handle null package entries
Sort package only after null/bad elements have been removed.
Fixes a problem where the _CST sort was performed too early. This
change sorts the package only after null/bad elements have been
removed.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/nsrepair2.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c index 029816edd392..c84603ee83ae 100644 --- a/drivers/acpi/acpica/nsrepair2.c +++ b/drivers/acpi/acpica/nsrepair2.c @@ -452,18 +452,7 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info, ACPI_FUNCTION_NAME(ns_repair_CST); /* - * Entries (subpackages) in the _CST Package must be sorted by the - * C-state type, in ascending order. - */ - status = acpi_ns_check_sorted_list(info, return_object, 1, 4, 1, - ACPI_SORT_ASCENDING, "C-State Type"); - if (ACPI_FAILURE(status)) { - return (status); - } - - /* - * We now know the list is correctly sorted by C-state type. Check if - * the C-state type values are proportional. + * Check if the C-state type values are proportional. */ outer_element_count = return_object->package.count - 1; i = 0; @@ -502,6 +491,17 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info, obj_desc = return_object->package.elements[0]; obj_desc->integer.value = outer_element_count; + + /* + * Entries (subpackages) in the _CST Package must be sorted by the + * C-state type, in ascending order. + */ + status = acpi_ns_check_sorted_list(info, return_object, 1, 4, 1, + ACPI_SORT_ASCENDING, "C-State Type"); + if (ACPI_FAILURE(status)) { + return (status); + } + return (AE_OK); } |