forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/acpi/acpica/dspkginit.c
....@@ -3,7 +3,7 @@
33 *
44 * Module Name: dspkginit - Completion of deferred package initialization
55 *
6
- * Copyright (C) 2000 - 2018, Intel Corp.
6
+ * Copyright (C) 2000 - 2020, Intel Corp.
77 *
88 *****************************************************************************/
99
....@@ -152,6 +152,32 @@
152152 */
153153 for (i = 0; arg && (i < element_count); i++) {
154154 if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
155
+ if (!arg->common.node) {
156
+ /*
157
+ * This is the case where an expression has returned a value.
158
+ * The use of expressions (term_args) within individual
159
+ * package elements is not supported by the AML interpreter,
160
+ * even though the ASL grammar supports it. Example:
161
+ *
162
+ * Name (INT1, 0x1234)
163
+ *
164
+ * Name (PKG3, Package () {
165
+ * Add (INT1, 0xAAAA0000)
166
+ * })
167
+ *
168
+ * 1) No known AML interpreter supports this type of construct
169
+ * 2) This fixes a fault if the construct is encountered
170
+ */
171
+ ACPI_EXCEPTION((AE_INFO, AE_SUPPORT,
172
+ "Expressions within package elements are not supported"));
173
+
174
+ /* Cleanup the return object, it is not needed */
175
+
176
+ acpi_ut_remove_reference(walk_state->results->
177
+ results.obj_desc[0]);
178
+ return_ACPI_STATUS(AE_SUPPORT);
179
+ }
180
+
155181 if (arg->common.node->type == ACPI_TYPE_METHOD) {
156182 /*
157183 * A method reference "looks" to the parser to be a method