ACPICA: Add several repairs for _CST predefined name
Sort list based on the C-state, remove invalid/zero entries.
ACPICA BZ 890. Lv Zheng.
Fixes these possible problems with the _CST object:
1. Sort the list ascending by C state type.
2. Ensure type cannot be zero.
3. A sub-package count of zero means _CST is meaningless.
4. Count must match the number of C state sub-packages.
References: https://bugs.acpica.org/show_bug.cgi?id=890
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>
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 8d59ac2..24b71a0 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -159,9 +159,10 @@
status = acpi_ns_check_package(info, return_object_ptr);
if (ACPI_FAILURE(status)) {
- /* We might be able to fix an operand type error (_PRT) */
+ /* We might be able to fix some errors */
- if (status != AE_AML_OPERAND_TYPE) {
+ if ((status != AE_AML_OPERAND_TYPE) &&
+ (status != AE_AML_OPERAND_VALUE)) {
goto exit;
}
}