hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/acpi/acpica/dsfield.c
....@@ -3,7 +3,7 @@
33 *
44 * Module Name: dsfield - Dispatcher field routines
55 *
6
- * Copyright (C) 2000 - 2018, Intel Corp.
6
+ * Copyright (C) 2000 - 2020, Intel Corp.
77 *
88 *****************************************************************************/
99
....@@ -149,7 +149,6 @@
149149
150150 if (walk_state->deferred_node) {
151151 node = walk_state->deferred_node;
152
- status = AE_OK;
153152 } else {
154153 /* Execute flag should always be set when this function is entered */
155154
....@@ -178,7 +177,10 @@
178177 arg->common.value.string, ACPI_TYPE_ANY,
179178 ACPI_IMODE_LOAD_PASS1, flags,
180179 walk_state, &node);
181
- if (ACPI_FAILURE(status)) {
180
+ if ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE)
181
+ && status == AE_ALREADY_EXISTS) {
182
+ status = AE_OK;
183
+ } else if (ACPI_FAILURE(status)) {
182184 ACPI_ERROR_NAMESPACE(walk_state->scope_info,
183185 arg->common.value.string, status);
184186 return_ACPI_STATUS(status);
....@@ -264,7 +266,6 @@
264266 union acpi_parse_object *child;
265267
266268 #ifdef ACPI_EXEC_APP
267
- u64 value = 0;
268269 union acpi_operand_object *result_desc;
269270 union acpi_operand_object *obj_desc;
270271 char *name_path;
....@@ -406,19 +407,17 @@
406407 name_path =
407408 acpi_ns_get_external_pathname(info->
408409 field_node);
409
- obj_desc =
410
- acpi_ut_create_integer_object
411
- (value);
412410 if (ACPI_SUCCESS
413411 (ae_lookup_init_file_entry
414
- (name_path, &value))) {
412
+ (name_path, &obj_desc))) {
415413 acpi_ex_write_data_to_field
416414 (obj_desc,
417415 acpi_ns_get_attached_object
418416 (info->field_node),
419417 &result_desc);
418
+ acpi_ut_remove_reference
419
+ (obj_desc);
420420 }
421
- acpi_ut_remove_reference(obj_desc);
422421 ACPI_FREE(name_path);
423422 #endif
424423 }
....@@ -518,6 +517,20 @@
518517 info.region_node = region_node;
519518
520519 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
520
+ if (ACPI_FAILURE(status)) {
521
+ return_ACPI_STATUS(status);
522
+ }
523
+
524
+ if (info.region_node->object->region.space_id ==
525
+ ACPI_ADR_SPACE_PLATFORM_COMM) {
526
+ region_node->object->field.internal_pcc_buffer =
527
+ ACPI_ALLOCATE_ZEROED(info.region_node->object->region.
528
+ length);
529
+ if (!region_node->object->field.internal_pcc_buffer) {
530
+ return_ACPI_STATUS(AE_NO_MEMORY);
531
+ }
532
+ }
533
+
521534 return_ACPI_STATUS(status);
522535 }
523536
....@@ -629,8 +642,6 @@
629642 }
630643
631644 /* Name already exists, just ignore this error */
632
-
633
- status = AE_OK;
634645 }
635646
636647 arg->common.node = node;