aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r--drivers/acpi/executer/exconfig.c5
-rw-r--r--drivers/acpi/executer/exconvrt.c2
-rw-r--r--drivers/acpi/executer/exdump.c2
-rw-r--r--drivers/acpi/executer/exfield.c2
-rw-r--r--drivers/acpi/executer/exfldio.c5
-rw-r--r--drivers/acpi/executer/exmisc.c1
-rw-r--r--drivers/acpi/executer/exmutex.c3
-rw-r--r--drivers/acpi/executer/exnames.c6
-rw-r--r--drivers/acpi/executer/exoparg1.c44
-rw-r--r--drivers/acpi/executer/exoparg2.c77
-rw-r--r--drivers/acpi/executer/exoparg3.c2
-rw-r--r--drivers/acpi/executer/exoparg6.c1
-rw-r--r--drivers/acpi/executer/exregion.c1
-rw-r--r--drivers/acpi/executer/exresnte.c5
-rw-r--r--drivers/acpi/executer/exresolv.c43
-rw-r--r--drivers/acpi/executer/exresop.c4
-rw-r--r--drivers/acpi/executer/exstore.c2
-rw-r--r--drivers/acpi/executer/exstoren.c3
-rw-r--r--drivers/acpi/executer/exstorob.c3
-rw-r--r--drivers/acpi/executer/exsystem.c2
-rw-r--r--drivers/acpi/executer/exutils.c3
21 files changed, 147 insertions, 69 deletions
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index a29782fe3ecf..864530f754c3 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -110,6 +110,7 @@ acpi_ex_add_table(struct acpi_table_header *table,
110 110
111 if (ACPI_FAILURE(status)) { 111 if (ACPI_FAILURE(status)) {
112 if (status == AE_ALREADY_EXISTS) { 112 if (status == AE_ALREADY_EXISTS) {
113
113 /* Table already exists, just return the handle */ 114 /* Table already exists, just return the handle */
114 115
115 return_ACPI_STATUS(AE_OK); 116 return_ACPI_STATUS(AE_OK);
@@ -121,6 +122,7 @@ acpi_ex_add_table(struct acpi_table_header *table,
121 122
122 status = acpi_ns_load_table(table_info.installed_desc, parent_node); 123 status = acpi_ns_load_table(table_info.installed_desc, parent_node);
123 if (ACPI_FAILURE(status)) { 124 if (ACPI_FAILURE(status)) {
125
124 /* Uninstall table on error */ 126 /* Uninstall table on error */
125 127
126 (void)acpi_tb_uninstall_table(table_info.installed_desc); 128 (void)acpi_tb_uninstall_table(table_info.installed_desc);
@@ -169,6 +171,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
169 */ 171 */
170 status = acpi_tb_match_signature(operand[0]->string.pointer, NULL); 172 status = acpi_tb_match_signature(operand[0]->string.pointer, NULL);
171 if (status == AE_OK) { 173 if (status == AE_OK) {
174
172 /* Signature matched -- don't allow override */ 175 /* Signature matched -- don't allow override */
173 176
174 return_ACPI_STATUS(AE_ALREADY_EXISTS); 177 return_ACPI_STATUS(AE_ALREADY_EXISTS);
@@ -252,6 +255,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
252 /* Parameter Data (optional) */ 255 /* Parameter Data (optional) */
253 256
254 if (parameter_node) { 257 if (parameter_node) {
258
255 /* Store the parameter data into the optional parameter object */ 259 /* Store the parameter data into the optional parameter object */
256 260
257 status = acpi_ex_store(operand[5], 261 status = acpi_ex_store(operand[5],
@@ -424,6 +428,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
424 428
425 status = acpi_ex_add_table(table_ptr, acpi_gbl_root_node, &ddb_handle); 429 status = acpi_ex_add_table(table_ptr, acpi_gbl_root_node, &ddb_handle);
426 if (ACPI_FAILURE(status)) { 430 if (ACPI_FAILURE(status)) {
431
427 /* On error, table_ptr was deallocated above */ 432 /* On error, table_ptr was deallocated above */
428 433
429 return_ACPI_STATUS(status); 434 return_ACPI_STATUS(status);
diff --git a/drivers/acpi/executer/exconvrt.c b/drivers/acpi/executer/exconvrt.c
index e6d52e12d77a..a2c93c9ba07c 100644
--- a/drivers/acpi/executer/exconvrt.c
+++ b/drivers/acpi/executer/exconvrt.c
@@ -319,6 +319,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer,
319 remainder = 0; 319 remainder = 0;
320 320
321 for (i = decimal_length; i > 0; i--) { 321 for (i = decimal_length; i > 0; i--) {
322
322 /* Divide by nth factor of 10 */ 323 /* Divide by nth factor of 10 */
323 324
324 digit = integer; 325 digit = integer;
@@ -346,6 +347,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer,
346 347
347 hex_length = (acpi_native_uint) ACPI_MUL_2(data_width); 348 hex_length = (acpi_native_uint) ACPI_MUL_2(data_width);
348 for (i = 0, j = (hex_length - 1); i < hex_length; i++, j--) { 349 for (i = 0, j = (hex_length - 1); i < hex_length; i++, j--) {
350
349 /* Get one hex digit, most significant digits first */ 351 /* Get one hex digit, most significant digits first */
350 352
351 string[k] = 353 string[k] =
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index a7cca8d4f855..0a53d31e09de 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -463,6 +463,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
463 } 463 }
464 464
465 if (!obj_desc) { 465 if (!obj_desc) {
466
466 /* This could be a null element of a package */ 467 /* This could be a null element of a package */
467 468
468 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n")); 469 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n"));
@@ -532,6 +533,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
532 obj_desc->reference.offset); 533 obj_desc->reference.offset);
533 534
534 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { 535 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
536
535 /* Value is an Integer */ 537 /* Value is an Integer */
536 538
537 acpi_os_printf(" value is [%8.8X%8.8x]", 539 acpi_os_printf(" value is [%8.8X%8.8x]",
diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c
index e259201ce9a0..215783a33c2c 100644
--- a/drivers/acpi/executer/exfield.c
+++ b/drivers/acpi/executer/exfield.c
@@ -142,6 +142,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
142 length = 142 length =
143 (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length); 143 (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length);
144 if (length > acpi_gbl_integer_byte_width) { 144 if (length > acpi_gbl_integer_byte_width) {
145
145 /* Field is too large for an Integer, create a Buffer instead */ 146 /* Field is too large for an Integer, create a Buffer instead */
146 147
147 buffer_desc = acpi_ut_create_buffer_object(length); 148 buffer_desc = acpi_ut_create_buffer_object(length);
@@ -329,6 +330,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
329 ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length); 330 ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length);
330 331
331 if (length < required_length) { 332 if (length < required_length) {
333
332 /* We need to create a new buffer */ 334 /* We need to create a new buffer */
333 335
334 new_buffer = ACPI_MEM_CALLOCATE(required_length); 336 new_buffer = ACPI_MEM_CALLOCATE(required_length);
diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c
index bd1af35f7fcf..d5a4b2627c19 100644
--- a/drivers/acpi/executer/exfldio.c
+++ b/drivers/acpi/executer/exfldio.c
@@ -113,6 +113,7 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
113 } 113 }
114 114
115 if (rgn_desc->region.space_id == ACPI_ADR_SPACE_SMBUS) { 115 if (rgn_desc->region.space_id == ACPI_ADR_SPACE_SMBUS) {
116
116 /* SMBus has a non-linear address space */ 117 /* SMBus has a non-linear address space */
117 118
118 return_ACPI_STATUS(AE_OK); 119 return_ACPI_STATUS(AE_OK);
@@ -491,6 +492,7 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc,
491 value)); 492 value));
492 493
493 if (read_write == ACPI_READ) { 494 if (read_write == ACPI_READ) {
495
494 /* Read the datum from the data_register */ 496 /* Read the datum from the data_register */
495 497
496 status = 498 status =
@@ -568,6 +570,7 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
568 /* If the mask is all ones, we don't need to worry about the update rule */ 570 /* If the mask is all ones, we don't need to worry about the update rule */
569 571
570 if (mask != ACPI_INTEGER_MAX) { 572 if (mask != ACPI_INTEGER_MAX) {
573
571 /* Decode the update rule */ 574 /* Decode the update rule */
572 575
573 switch (obj_desc->common_field. 576 switch (obj_desc->common_field.
@@ -704,6 +707,7 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
704 /* Read the rest of the field */ 707 /* Read the rest of the field */
705 708
706 for (i = 1; i < field_datum_count; i++) { 709 for (i = 1; i < field_datum_count; i++) {
710
707 /* Get next input datum from the field */ 711 /* Get next input datum from the field */
708 712
709 field_offset += obj_desc->common_field.access_byte_width; 713 field_offset += obj_desc->common_field.access_byte_width;
@@ -817,6 +821,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
817 /* Write the entire field */ 821 /* Write the entire field */
818 822
819 for (i = 1; i < field_datum_count; i++) { 823 for (i = 1; i < field_datum_count; i++) {
824
820 /* Write merged datum to the target field */ 825 /* Write merged datum to the target field */
821 826
822 merged_datum &= mask; 827 merged_datum &= mask;
diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c
index 48c18d29222a..74f2c1a9bdaf 100644
--- a/drivers/acpi/executer/exmisc.c
+++ b/drivers/acpi/executer/exmisc.c
@@ -649,6 +649,7 @@ acpi_ex_do_logical_op(u16 opcode,
649 /* Length and all bytes must be equal */ 649 /* Length and all bytes must be equal */
650 650
651 if ((length0 == length1) && (compare == 0)) { 651 if ((length0 == length1) && (compare == 0)) {
652
652 /* Length and all bytes match ==> TRUE */ 653 /* Length and all bytes match ==> TRUE */
653 654
654 local_result = TRUE; 655 local_result = TRUE;
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index f843b22e20b9..eaee1de5e90d 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -173,6 +173,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
173 /* Support for multiple acquires by the owning thread */ 173 /* Support for multiple acquires by the owning thread */
174 174
175 if (obj_desc->mutex.owner_thread) { 175 if (obj_desc->mutex.owner_thread) {
176
176 /* Special case for Global Lock, allow all threads */ 177 /* Special case for Global Lock, allow all threads */
177 178
178 if ((obj_desc->mutex.owner_thread->thread_id == 179 if ((obj_desc->mutex.owner_thread->thread_id ==
@@ -192,6 +193,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
192 193
193 status = acpi_ex_system_acquire_mutex(time_desc, obj_desc); 194 status = acpi_ex_system_acquire_mutex(time_desc, obj_desc);
194 if (ACPI_FAILURE(status)) { 195 if (ACPI_FAILURE(status)) {
196
195 /* Includes failure from a timeout on time_desc */ 197 /* Includes failure from a timeout on time_desc */
196 198
197 return_ACPI_STATUS(status); 199 return_ACPI_STATUS(status);
@@ -286,6 +288,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
286 288
287 obj_desc->mutex.acquisition_depth--; 289 obj_desc->mutex.acquisition_depth--;
288 if (obj_desc->mutex.acquisition_depth != 0) { 290 if (obj_desc->mutex.acquisition_depth != 0) {
291
289 /* Just decrement the depth and return */ 292 /* Just decrement the depth and return */
290 293
291 return_ACPI_STATUS(AE_OK); 294 return_ACPI_STATUS(AE_OK);
diff --git a/drivers/acpi/executer/exnames.c b/drivers/acpi/executer/exnames.c
index 054fe5e1a314..f9bc81c1b78d 100644
--- a/drivers/acpi/executer/exnames.c
+++ b/drivers/acpi/executer/exnames.c
@@ -85,6 +85,7 @@ static char *acpi_ex_allocate_name_string(u32 prefix_count, u32 num_name_segs)
85 * This may actually be somewhat longer than needed. 85 * This may actually be somewhat longer than needed.
86 */ 86 */
87 if (prefix_count == ACPI_UINT32_MAX) { 87 if (prefix_count == ACPI_UINT32_MAX) {
88
88 /* Special case for root */ 89 /* Special case for root */
89 90
90 size_needed = 1 + (ACPI_NAME_SIZE * num_name_segs) + 2 + 1; 91 size_needed = 1 + (ACPI_NAME_SIZE * num_name_segs) + 2 + 1;
@@ -119,11 +120,13 @@ static char *acpi_ex_allocate_name_string(u32 prefix_count, u32 num_name_segs)
119 /* Set up Dual or Multi prefixes if needed */ 120 /* Set up Dual or Multi prefixes if needed */
120 121
121 if (num_name_segs > 2) { 122 if (num_name_segs > 2) {
123
122 /* Set up multi prefixes */ 124 /* Set up multi prefixes */
123 125
124 *temp_ptr++ = AML_MULTI_NAME_PREFIX_OP; 126 *temp_ptr++ = AML_MULTI_NAME_PREFIX_OP;
125 *temp_ptr++ = (char)num_name_segs; 127 *temp_ptr++ = (char)num_name_segs;
126 } else if (2 == num_name_segs) { 128 } else if (2 == num_name_segs) {
129
127 /* Set up dual prefixes */ 130 /* Set up dual prefixes */
128 131
129 *temp_ptr++ = AML_DUAL_NAME_PREFIX; 132 *temp_ptr++ = AML_DUAL_NAME_PREFIX;
@@ -184,6 +187,7 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
184 /* Valid name segment */ 187 /* Valid name segment */
185 188
186 if (index == 4) { 189 if (index == 4) {
190
187 /* Found 4 valid characters */ 191 /* Found 4 valid characters */
188 192
189 char_buf[4] = '\0'; 193 char_buf[4] = '\0';
@@ -254,6 +258,7 @@ acpi_ex_get_name_string(acpi_object_type data_type,
254 if (ACPI_TYPE_LOCAL_REGION_FIELD == data_type || 258 if (ACPI_TYPE_LOCAL_REGION_FIELD == data_type ||
255 ACPI_TYPE_LOCAL_BANK_FIELD == data_type || 259 ACPI_TYPE_LOCAL_BANK_FIELD == data_type ||
256 ACPI_TYPE_LOCAL_INDEX_FIELD == data_type) { 260 ACPI_TYPE_LOCAL_INDEX_FIELD == data_type) {
261
257 /* Disallow prefixes for types associated with field_unit names */ 262 /* Disallow prefixes for types associated with field_unit names */
258 263
259 name_string = acpi_ex_allocate_name_string(0, 1); 264 name_string = acpi_ex_allocate_name_string(0, 1);
@@ -410,6 +415,7 @@ acpi_ex_get_name_string(acpi_object_type data_type,
410 } 415 }
411 416
412 if (AE_CTRL_PENDING == status && has_prefix) { 417 if (AE_CTRL_PENDING == status && has_prefix) {
418
413 /* Ran out of segments after processing a prefix */ 419 /* Ran out of segments after processing a prefix */
414 420
415 ACPI_ERROR((AE_INFO, "Malformed Name at %p", name_string)); 421 ACPI_ERROR((AE_INFO, "Malformed Name at %p", name_string));
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index 23d0823bcd5e..4f3627ee2b2b 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -342,6 +342,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
342 for (i = 0; 342 for (i = 0;
343 (i < acpi_gbl_integer_nybble_width) && (digit > 0); 343 (i < acpi_gbl_integer_nybble_width) && (digit > 0);
344 i++) { 344 i++) {
345
345 /* Get the least significant 4-bit BCD digit */ 346 /* Get the least significant 4-bit BCD digit */
346 347
347 temp32 = ((u32) digit) & 0xF; 348 temp32 = ((u32) digit) & 0xF;
@@ -487,6 +488,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
487 status = acpi_ex_convert_to_string(operand[0], &return_desc, 488 status = acpi_ex_convert_to_string(operand[0], &return_desc,
488 ACPI_EXPLICIT_CONVERT_DECIMAL); 489 ACPI_EXPLICIT_CONVERT_DECIMAL);
489 if (return_desc == operand[0]) { 490 if (return_desc == operand[0]) {
491
490 /* No conversion performed, add ref to handle return value */ 492 /* No conversion performed, add ref to handle return value */
491 acpi_ut_add_reference(return_desc); 493 acpi_ut_add_reference(return_desc);
492 } 494 }
@@ -497,6 +499,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
497 status = acpi_ex_convert_to_string(operand[0], &return_desc, 499 status = acpi_ex_convert_to_string(operand[0], &return_desc,
498 ACPI_EXPLICIT_CONVERT_HEX); 500 ACPI_EXPLICIT_CONVERT_HEX);
499 if (return_desc == operand[0]) { 501 if (return_desc == operand[0]) {
502
500 /* No conversion performed, add ref to handle return value */ 503 /* No conversion performed, add ref to handle return value */
501 acpi_ut_add_reference(return_desc); 504 acpi_ut_add_reference(return_desc);
502 } 505 }
@@ -506,6 +509,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
506 509
507 status = acpi_ex_convert_to_buffer(operand[0], &return_desc); 510 status = acpi_ex_convert_to_buffer(operand[0], &return_desc);
508 if (return_desc == operand[0]) { 511 if (return_desc == operand[0]) {
512
509 /* No conversion performed, add ref to handle return value */ 513 /* No conversion performed, add ref to handle return value */
510 acpi_ut_add_reference(return_desc); 514 acpi_ut_add_reference(return_desc);
511 } 515 }
@@ -516,6 +520,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
516 status = acpi_ex_convert_to_integer(operand[0], &return_desc, 520 status = acpi_ex_convert_to_integer(operand[0], &return_desc,
517 ACPI_ANY_BASE); 521 ACPI_ANY_BASE);
518 if (return_desc == operand[0]) { 522 if (return_desc == operand[0]) {
523
519 /* No conversion performed, add ref to handle return value */ 524 /* No conversion performed, add ref to handle return value */
520 acpi_ut_add_reference(return_desc); 525 acpi_ut_add_reference(return_desc);
521 } 526 }
@@ -541,6 +546,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
541 } 546 }
542 547
543 if (ACPI_SUCCESS(status)) { 548 if (ACPI_SUCCESS(status)) {
549
544 /* Store the return value computed above into the target object */ 550 /* Store the return value computed above into the target object */
545 551
546 status = acpi_ex_store(return_desc, operand[1], walk_state); 552 status = acpi_ex_store(return_desc, operand[1], walk_state);
@@ -625,6 +631,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
625 temp_desc = operand[0]; 631 temp_desc = operand[0];
626 if (ACPI_GET_DESCRIPTOR_TYPE(temp_desc) == 632 if (ACPI_GET_DESCRIPTOR_TYPE(temp_desc) ==
627 ACPI_DESC_TYPE_OPERAND) { 633 ACPI_DESC_TYPE_OPERAND) {
634
628 /* Internal reference object - prevent deletion */ 635 /* Internal reference object - prevent deletion */
629 636
630 acpi_ut_add_reference(temp_desc); 637 acpi_ut_add_reference(temp_desc);
@@ -777,8 +784,25 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
777 784
778 /* Check for a method local or argument, or standalone String */ 785 /* Check for a method local or argument, or standalone String */
779 786
780 if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) != 787 if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) ==
781 ACPI_DESC_TYPE_NAMED) { 788 ACPI_DESC_TYPE_NAMED) {
789 temp_desc =
790 acpi_ns_get_attached_object((struct
791 acpi_namespace_node *)
792 operand[0]);
793 if (temp_desc
794 &&
795 ((ACPI_GET_OBJECT_TYPE(temp_desc) ==
796 ACPI_TYPE_STRING)
797 || (ACPI_GET_OBJECT_TYPE(temp_desc) ==
798 ACPI_TYPE_LOCAL_REFERENCE))) {
799 operand[0] = temp_desc;
800 acpi_ut_add_reference(temp_desc);
801 } else {
802 status = AE_AML_OPERAND_TYPE;
803 goto cleanup;
804 }
805 } else {
782 switch (ACPI_GET_OBJECT_TYPE(operand[0])) { 806 switch (ACPI_GET_OBJECT_TYPE(operand[0])) {
783 case ACPI_TYPE_LOCAL_REFERENCE: 807 case ACPI_TYPE_LOCAL_REFERENCE:
784 /* 808 /*
@@ -827,13 +851,24 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
827 break; 851 break;
828 852
829 case ACPI_TYPE_STRING: 853 case ACPI_TYPE_STRING:
854 break;
830 855
856 default:
857 status = AE_AML_OPERAND_TYPE;
858 goto cleanup;
859 }
860 }
861
862 if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) !=
863 ACPI_DESC_TYPE_NAMED) {
864 if (ACPI_GET_OBJECT_TYPE(operand[0]) ==
865 ACPI_TYPE_STRING) {
831 /* 866 /*
832 * This is a deref_of (String). The string is a reference 867 * This is a deref_of (String). The string is a reference
833 * to a named ACPI object. 868 * to a named ACPI object.
834 * 869 *
835 * 1) Find the owning Node 870 * 1) Find the owning Node
836 * 2) Dereference the node to an actual object. Could be a 871 * 2) Dereference the node to an actual object. Could be a
837 * Field, so we need to resolve the node to a value. 872 * Field, so we need to resolve the node to a value.
838 */ 873 */
839 status = 874 status =
@@ -857,11 +892,6 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
857 (struct acpi_namespace_node, &return_desc), 892 (struct acpi_namespace_node, &return_desc),
858 walk_state); 893 walk_state);
859 goto cleanup; 894 goto cleanup;
860
861 default:
862
863 status = AE_AML_OPERAND_TYPE;
864 goto cleanup;
865 } 895 }
866 } 896 }
867 897
diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c
index e263a5ddd405..5e1abb12c748 100644
--- a/drivers/acpi/executer/exoparg2.c
+++ b/drivers/acpi/executer/exoparg2.c
@@ -138,6 +138,7 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state)
138 acpi_ev_check_for_wake_only_gpe(walk_state-> 138 acpi_ev_check_for_wake_only_gpe(walk_state->
139 gpe_event_info); 139 gpe_event_info);
140 if (ACPI_FAILURE(status)) { 140 if (ACPI_FAILURE(status)) {
141
141 /* AE_WAKE_ONLY_GPE only error, means ignore this notify */ 142 /* AE_WAKE_ONLY_GPE only error, means ignore this notify */
142 143
143 return_ACPI_STATUS(AE_OK) 144 return_ACPI_STATUS(AE_OK)
@@ -252,6 +253,7 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state)
252 acpi_ut_remove_reference(return_desc2); 253 acpi_ut_remove_reference(return_desc2);
253 254
254 if (ACPI_FAILURE(status)) { 255 if (ACPI_FAILURE(status)) {
256
255 /* Delete the return object */ 257 /* Delete the return object */
256 258
257 acpi_ut_remove_reference(return_desc1); 259 acpi_ut_remove_reference(return_desc1);
@@ -287,6 +289,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
287 /* Execute the opcode */ 289 /* Execute the opcode */
288 290
289 if (walk_state->op_info->flags & AML_MATH) { 291 if (walk_state->op_info->flags & AML_MATH) {
292
290 /* All simple math opcodes (add, etc.) */ 293 /* All simple math opcodes (add, etc.) */
291 294
292 return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); 295 return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
@@ -383,54 +386,70 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
383 goto cleanup; 386 goto cleanup;
384 } 387 }
385 388
389 /* Initialize the Index reference object */
390
386 index = operand[1]->integer.value; 391 index = operand[1]->integer.value;
392 return_desc->reference.offset = (u32) index;
393 return_desc->reference.opcode = AML_INDEX_OP;
394 return_desc->reference.object = operand[0];
387 395
388 /* At this point, the Source operand is a Package, Buffer, or String */ 396 /*
397 * At this point, the Source operand is a String, Buffer, or Package.
398 * Verify that the index is within range.
399 */
400 switch (ACPI_GET_OBJECT_TYPE(operand[0])) {
401 case ACPI_TYPE_STRING:
389 402
390 if (ACPI_GET_OBJECT_TYPE(operand[0]) == ACPI_TYPE_PACKAGE) { 403 if (index >= operand[0]->string.length) {
391 /* Object to be indexed is a Package */ 404 status = AE_AML_STRING_LIMIT;
405 }
406
407 return_desc->reference.target_type =
408 ACPI_TYPE_BUFFER_FIELD;
409 break;
410
411 case ACPI_TYPE_BUFFER:
412
413 if (index >= operand[0]->buffer.length) {
414 status = AE_AML_BUFFER_LIMIT;
415 }
416
417 return_desc->reference.target_type =
418 ACPI_TYPE_BUFFER_FIELD;
419 break;
420
421 case ACPI_TYPE_PACKAGE:
392 422
393 if (index >= operand[0]->package.count) { 423 if (index >= operand[0]->package.count) {
394 ACPI_ERROR((AE_INFO,
395 "Index value (%X%8.8X) beyond package end (%X)",
396 ACPI_FORMAT_UINT64(index),
397 operand[0]->package.count));
398 status = AE_AML_PACKAGE_LIMIT; 424 status = AE_AML_PACKAGE_LIMIT;
399 goto cleanup;
400 } 425 }
401 426
402 return_desc->reference.target_type = ACPI_TYPE_PACKAGE; 427 return_desc->reference.target_type = ACPI_TYPE_PACKAGE;
403 return_desc->reference.object = operand[0];
404 return_desc->reference.where = 428 return_desc->reference.where =
405 &operand[0]->package.elements[index]; 429 &operand[0]->package.elements[index];
406 } else { 430 break;
407 /* Object to be indexed is a Buffer/String */
408 431
409 if (index >= operand[0]->buffer.length) { 432 default:
410 ACPI_ERROR((AE_INFO,
411 "Index value (%X%8.8X) beyond end of buffer (%X)",
412 ACPI_FORMAT_UINT64(index),
413 operand[0]->buffer.length));
414 status = AE_AML_BUFFER_LIMIT;
415 goto cleanup;
416 }
417 433
418 return_desc->reference.target_type = 434 status = AE_AML_INTERNAL;
419 ACPI_TYPE_BUFFER_FIELD; 435 goto cleanup;
420 return_desc->reference.object = operand[0]; 436 }
437
438 /* Failure means that the Index was beyond the end of the object */
439
440 if (ACPI_FAILURE(status)) {
441 ACPI_EXCEPTION((AE_INFO, status,
442 "Index (%X%8.8X) is beyond end of object",
443 ACPI_FORMAT_UINT64(index)));
444 goto cleanup;
421 } 445 }
422 446
423 /* 447 /*
424 * Add a reference to the target package/buffer/string for the life 448 * Add a reference to the target package/buffer/string for the life
425 * of the index. 449 * of the index
426 */ 450 */
427 acpi_ut_add_reference(operand[0]); 451 acpi_ut_add_reference(operand[0]);
428 452
429 /* Complete the Index reference object */
430
431 return_desc->reference.opcode = AML_INDEX_OP;
432 return_desc->reference.offset = (u32) index;
433
434 /* Store the reference to the Target */ 453 /* Store the reference to the Target */
435 454
436 status = acpi_ex_store(return_desc, operand[2], walk_state); 455 status = acpi_ex_store(return_desc, operand[2], walk_state);
@@ -509,6 +528,7 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
509 /* Execute the Opcode */ 528 /* Execute the Opcode */
510 529
511 if (walk_state->op_info->flags & AML_LOGICAL_NUMERIC) { 530 if (walk_state->op_info->flags & AML_LOGICAL_NUMERIC) {
531
512 /* logical_op (Operand0, Operand1) */ 532 /* logical_op (Operand0, Operand1) */
513 533
514 status = acpi_ex_do_logical_numeric_op(walk_state->opcode, 534 status = acpi_ex_do_logical_numeric_op(walk_state->opcode,
@@ -518,6 +538,7 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
518 value, &logical_result); 538 value, &logical_result);
519 goto store_logical_result; 539 goto store_logical_result;
520 } else if (walk_state->op_info->flags & AML_LOGICAL) { 540 } else if (walk_state->op_info->flags & AML_LOGICAL) {
541
521 /* logical_op (Operand0, Operand1) */ 542 /* logical_op (Operand0, Operand1) */
522 543
523 status = acpi_ex_do_logical_op(walk_state->opcode, operand[0], 544 status = acpi_ex_do_logical_op(walk_state->opcode, operand[0],
diff --git a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c
index 6a3a883cb8a3..8da794ec35b0 100644
--- a/drivers/acpi/executer/exoparg3.c
+++ b/drivers/acpi/executer/exoparg3.c
@@ -208,6 +208,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
208 /* If the requested length is zero, don't allocate a buffer */ 208 /* If the requested length is zero, don't allocate a buffer */
209 209
210 if (length > 0) { 210 if (length > 0) {
211
211 /* Allocate a new buffer for the Buffer */ 212 /* Allocate a new buffer for the Buffer */
212 213
213 buffer = ACPI_MEM_CALLOCATE(length); 214 buffer = ACPI_MEM_CALLOCATE(length);
@@ -225,6 +226,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
225 } 226 }
226 227
227 if (buffer) { 228 if (buffer) {
229
228 /* We have a buffer, copy the portion requested */ 230 /* We have a buffer, copy the portion requested */
229 231
230 ACPI_MEMCPY(buffer, operand[0]->string.pointer + index, 232 ACPI_MEMCPY(buffer, operand[0]->string.pointer + index,
diff --git a/drivers/acpi/executer/exoparg6.c b/drivers/acpi/executer/exoparg6.c
index e043d924444f..33e4fb1addce 100644
--- a/drivers/acpi/executer/exoparg6.c
+++ b/drivers/acpi/executer/exoparg6.c
@@ -276,6 +276,7 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
276 * match was found. 276 * match was found.
277 */ 277 */
278 for (; index < operand[0]->package.count; index++) { 278 for (; index < operand[0]->package.count; index++) {
279
279 /* Get the current package element */ 280 /* Get the current package element */
280 281
281 this_element = operand[0]->package.elements[index]; 282 this_element = operand[0]->package.elements[index];
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
index 6a4cfdff606d..9db68d19253e 100644
--- a/drivers/acpi/executer/exregion.c
+++ b/drivers/acpi/executer/exregion.c
@@ -135,6 +135,7 @@ acpi_ex_system_memory_space_handler(u32 function,
135 * Delete the existing mapping and create a new one. 135 * Delete the existing mapping and create a new one.
136 */ 136 */
137 if (mem_info->mapped_length) { 137 if (mem_info->mapped_length) {
138
138 /* Valid mapping, delete it */ 139 /* Valid mapping, delete it */
139 140
140 acpi_os_unmap_memory(mem_info->mapped_logical_address, 141 acpi_os_unmap_memory(mem_info->mapped_logical_address,
diff --git a/drivers/acpi/executer/exresnte.c b/drivers/acpi/executer/exresnte.c
index 01b26c80d22b..417d914d9e19 100644
--- a/drivers/acpi/executer/exresnte.c
+++ b/drivers/acpi/executer/exresnte.c
@@ -103,6 +103,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
103 103
104 if ((entry_type == ACPI_TYPE_LOCAL_ALIAS) || 104 if ((entry_type == ACPI_TYPE_LOCAL_ALIAS) ||
105 (entry_type == ACPI_TYPE_LOCAL_METHOD_ALIAS)) { 105 (entry_type == ACPI_TYPE_LOCAL_METHOD_ALIAS)) {
106
106 /* There is always exactly one level of indirection */ 107 /* There is always exactly one level of indirection */
107 108
108 node = ACPI_CAST_PTR(struct acpi_namespace_node, node->object); 109 node = ACPI_CAST_PTR(struct acpi_namespace_node, node->object);
@@ -141,6 +142,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
141 142
142 status = acpi_ds_get_package_arguments(source_desc); 143 status = acpi_ds_get_package_arguments(source_desc);
143 if (ACPI_SUCCESS(status)) { 144 if (ACPI_SUCCESS(status)) {
145
144 /* Return an additional reference to the object */ 146 /* Return an additional reference to the object */
145 147
146 obj_desc = source_desc; 148 obj_desc = source_desc;
@@ -158,6 +160,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
158 160
159 status = acpi_ds_get_buffer_arguments(source_desc); 161 status = acpi_ds_get_buffer_arguments(source_desc);
160 if (ACPI_SUCCESS(status)) { 162 if (ACPI_SUCCESS(status)) {
163
161 /* Return an additional reference to the object */ 164 /* Return an additional reference to the object */
162 165
163 obj_desc = source_desc; 166 obj_desc = source_desc;
@@ -240,6 +243,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
240 /* This is a ddb_handle */ 243 /* This is a ddb_handle */
241 /* Return an additional reference to the object */ 244 /* Return an additional reference to the object */
242 245
246 case AML_REF_OF_OP:
247
243 obj_desc = source_desc; 248 obj_desc = source_desc;
244 acpi_ut_add_reference(obj_desc); 249 acpi_ut_add_reference(obj_desc);
245 break; 250 break;
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 1deed492fe88..22dabdd10604 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -382,10 +382,16 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
382 while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) { 382 while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
383 switch (obj_desc->reference.opcode) { 383 switch (obj_desc->reference.opcode) {
384 case AML_REF_OF_OP: 384 case AML_REF_OF_OP:
385 case AML_INT_NAMEPATH_OP:
385 386
386 /* Dereference the reference pointer */ 387 /* Dereference the reference pointer */
387 388
388 node = obj_desc->reference.object; 389 if (obj_desc->reference.opcode == AML_REF_OF_OP) {
390 node = obj_desc->reference.object;
391 } else { /* AML_INT_NAMEPATH_OP */
392
393 node = obj_desc->reference.node;
394 }
389 395
390 /* All "References" point to a NS node */ 396 /* All "References" point to a NS node */
391 397
@@ -401,6 +407,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
401 407
402 obj_desc = acpi_ns_get_attached_object(node); 408 obj_desc = acpi_ns_get_attached_object(node);
403 if (!obj_desc) { 409 if (!obj_desc) {
410
404 /* No object, use the NS node type */ 411 /* No object, use the NS node type */
405 412
406 type = acpi_ns_get_type(node); 413 type = acpi_ns_get_type(node);
@@ -432,6 +439,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
432 */ 439 */
433 obj_desc = *(obj_desc->reference.where); 440 obj_desc = *(obj_desc->reference.where);
434 if (!obj_desc) { 441 if (!obj_desc) {
442
435 /* NULL package elements are allowed */ 443 /* NULL package elements are allowed */
436 444
437 type = 0; /* Uninitialized */ 445 type = 0; /* Uninitialized */
@@ -439,39 +447,6 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
439 } 447 }
440 break; 448 break;
441 449
442 case AML_INT_NAMEPATH_OP:
443
444 /* Dereference the reference pointer */
445
446 node = obj_desc->reference.node;
447
448 /* All "References" point to a NS node */
449
450 if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
451 ACPI_DESC_TYPE_NAMED) {
452 ACPI_ERROR((AE_INFO, "Not a NS node %p [%s]",
453 node,
454 acpi_ut_get_descriptor_name(node)));
455 return_ACPI_STATUS(AE_AML_INTERNAL);
456 }
457
458 /* Get the attached object */
459
460 obj_desc = acpi_ns_get_attached_object(node);
461 if (!obj_desc) {
462 /* No object, use the NS node type */
463
464 type = acpi_ns_get_type(node);
465 goto exit;
466 }
467
468 /* Check for circular references */
469
470 if (obj_desc == operand) {
471 return_ACPI_STATUS(AE_AML_CIRCULAR_REFERENCE);
472 }
473 break;
474
475 case AML_LOCAL_OP: 450 case AML_LOCAL_OP:
476 case AML_ARG_OP: 451 case AML_ARG_OP:
477 452
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c
index a1c000f5a415..42b9089dccc0 100644
--- a/drivers/acpi/executer/exresop.c
+++ b/drivers/acpi/executer/exresop.c
@@ -77,6 +77,7 @@ acpi_ex_check_object_type(acpi_object_type type_needed,
77 ACPI_FUNCTION_ENTRY(); 77 ACPI_FUNCTION_ENTRY();
78 78
79 if (type_needed == ACPI_TYPE_ANY) { 79 if (type_needed == ACPI_TYPE_ANY) {
80
80 /* All types OK, so we don't perform any typechecks */ 81 /* All types OK, so we don't perform any typechecks */
81 82
82 return (AE_OK); 83 return (AE_OK);
@@ -224,6 +225,7 @@ acpi_ex_resolve_operands(u16 opcode,
224 } 225 }
225 226
226 if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) { 227 if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) {
228
227 /* Decode the Reference */ 229 /* Decode the Reference */
228 230
229 op_info = acpi_ps_get_opcode_info(opcode); 231 op_info = acpi_ps_get_opcode_info(opcode);
@@ -332,6 +334,7 @@ acpi_ex_resolve_operands(u16 opcode,
332 } 334 }
333 335
334 if (obj_desc->reference.opcode == AML_NAME_OP) { 336 if (obj_desc->reference.opcode == AML_NAME_OP) {
337
335 /* Convert a named reference to the actual named object */ 338 /* Convert a named reference to the actual named object */
336 339
337 temp_node = obj_desc->reference.object; 340 temp_node = obj_desc->reference.object;
@@ -662,6 +665,7 @@ acpi_ex_resolve_operands(u16 opcode,
662 } 665 }
663 666
664 if (target_op == AML_DEBUG_OP) { 667 if (target_op == AML_DEBUG_OP) {
668
665 /* Allow store of any object to the Debug object */ 669 /* Allow store of any object to the Debug object */
666 670
667 break; 671 break;
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index 3f020c0e2b95..287476f319f4 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -423,6 +423,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
423 } 423 }
424 424
425 if (obj_desc) { 425 if (obj_desc) {
426
426 /* Decrement reference count by the ref count of the parent package */ 427 /* Decrement reference count by the ref count of the parent package */
427 428
428 for (i = 0; i < ((union acpi_operand_object *) 429 for (i = 0; i < ((union acpi_operand_object *)
@@ -572,6 +573,7 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
572 /* If no implicit conversion, drop into the default case below */ 573 /* If no implicit conversion, drop into the default case below */
573 574
574 if ((!implicit_conversion) || (walk_state->opcode == AML_COPY_OP)) { 575 if ((!implicit_conversion) || (walk_state->opcode == AML_COPY_OP)) {
576
575 /* Force execution of default (no implicit conversion) */ 577 /* Force execution of default (no implicit conversion) */
576 578
577 target_type = ACPI_TYPE_ANY; 579 target_type = ACPI_TYPE_ANY;
diff --git a/drivers/acpi/executer/exstoren.c b/drivers/acpi/executer/exstoren.c
index 42967baf760d..969f9cbbbeeb 100644
--- a/drivers/acpi/executer/exstoren.c
+++ b/drivers/acpi/executer/exstoren.c
@@ -97,6 +97,7 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
97 */ 97 */
98 if (ACPI_GET_OBJECT_TYPE(source_desc) == 98 if (ACPI_GET_OBJECT_TYPE(source_desc) ==
99 ACPI_TYPE_LOCAL_REFERENCE) { 99 ACPI_TYPE_LOCAL_REFERENCE) {
100
100 /* Resolve a reference object first */ 101 /* Resolve a reference object first */
101 102
102 status = 103 status =
@@ -121,6 +122,7 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
121 !((ACPI_GET_OBJECT_TYPE(source_desc) == 122 !((ACPI_GET_OBJECT_TYPE(source_desc) ==
122 ACPI_TYPE_LOCAL_REFERENCE) 123 ACPI_TYPE_LOCAL_REFERENCE)
123 && (source_desc->reference.opcode == AML_LOAD_OP))) { 124 && (source_desc->reference.opcode == AML_LOAD_OP))) {
125
124 /* Conversion successful but still not a valid type */ 126 /* Conversion successful but still not a valid type */
125 127
126 ACPI_ERROR((AE_INFO, 128 ACPI_ERROR((AE_INFO,
@@ -289,6 +291,7 @@ acpi_ex_store_object_to_object(union acpi_operand_object *source_desc,
289 } 291 }
290 292
291 if (actual_src_desc != source_desc) { 293 if (actual_src_desc != source_desc) {
294
292 /* Delete the intermediate (temporary) source object */ 295 /* Delete the intermediate (temporary) source object */
293 296
294 acpi_ut_remove_reference(actual_src_desc); 297 acpi_ut_remove_reference(actual_src_desc);
diff --git a/drivers/acpi/executer/exstorob.c b/drivers/acpi/executer/exstorob.c
index 6ab707087750..41732d382bce 100644
--- a/drivers/acpi/executer/exstorob.c
+++ b/drivers/acpi/executer/exstorob.c
@@ -91,6 +91,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc,
91 /* Copy source buffer to target buffer */ 91 /* Copy source buffer to target buffer */
92 92
93 if (length <= target_desc->buffer.length) { 93 if (length <= target_desc->buffer.length) {
94
94 /* Clear existing buffer and copy in the new one */ 95 /* Clear existing buffer and copy in the new one */
95 96
96 ACPI_MEMSET(target_desc->buffer.pointer, 0, 97 ACPI_MEMSET(target_desc->buffer.pointer, 0,
@@ -113,6 +114,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc,
113 * copy must not truncate the original buffer. 114 * copy must not truncate the original buffer.
114 */ 115 */
115 if (original_src_type == ACPI_TYPE_STRING) { 116 if (original_src_type == ACPI_TYPE_STRING) {
117
116 /* Set the new length of the target */ 118 /* Set the new length of the target */
117 119
118 target_desc->buffer.length = length; 120 target_desc->buffer.length = length;
@@ -183,6 +185,7 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc,
183 */ 185 */
184 if (target_desc->string.pointer && 186 if (target_desc->string.pointer &&
185 (!(target_desc->common.flags & AOPOBJ_STATIC_POINTER))) { 187 (!(target_desc->common.flags & AOPOBJ_STATIC_POINTER))) {
188
186 /* Only free if not a pointer into the DSDT */ 189 /* Only free if not a pointer into the DSDT */
187 190
188 ACPI_MEM_FREE(target_desc->string.pointer); 191 ACPI_MEM_FREE(target_desc->string.pointer);
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
index ea9144f42e1f..6a2e47a0e112 100644
--- a/drivers/acpi/executer/exsystem.c
+++ b/drivers/acpi/executer/exsystem.c
@@ -76,6 +76,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout)
76 } 76 }
77 77
78 if (status == AE_TIME) { 78 if (status == AE_TIME) {
79
79 /* We must wait, so unlock the interpreter */ 80 /* We must wait, so unlock the interpreter */
80 81
81 acpi_ex_exit_interpreter(); 82 acpi_ex_exit_interpreter();
@@ -90,6 +91,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout)
90 91
91 status2 = acpi_ex_enter_interpreter(); 92 status2 = acpi_ex_enter_interpreter();
92 if (ACPI_FAILURE(status2)) { 93 if (ACPI_FAILURE(status2)) {
94
93 /* Report fatal error, could not acquire interpreter */ 95 /* Report fatal error, could not acquire interpreter */
94 96
95 return_ACPI_STATUS(status2); 97 return_ACPI_STATUS(status2);
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index f73a61aeb7ec..8543d1a0ed31 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -194,6 +194,7 @@ u8 acpi_ex_acquire_global_lock(u32 field_flags)
194 /* Only attempt lock if the always_lock bit is set */ 194 /* Only attempt lock if the always_lock bit is set */
195 195
196 if (field_flags & AML_FIELD_LOCK_RULE_MASK) { 196 if (field_flags & AML_FIELD_LOCK_RULE_MASK) {
197
197 /* We should attempt to get the lock, wait forever */ 198 /* We should attempt to get the lock, wait forever */
198 199
199 status = acpi_ev_acquire_global_lock(ACPI_WAIT_FOREVER); 200 status = acpi_ev_acquire_global_lock(ACPI_WAIT_FOREVER);
@@ -230,10 +231,12 @@ void acpi_ex_release_global_lock(u8 locked_by_me)
230 /* Only attempt unlock if the caller locked it */ 231 /* Only attempt unlock if the caller locked it */
231 232
232 if (locked_by_me) { 233 if (locked_by_me) {
234
233 /* OK, now release the lock */ 235 /* OK, now release the lock */
234 236
235 status = acpi_ev_release_global_lock(); 237 status = acpi_ev_release_global_lock();
236 if (ACPI_FAILURE(status)) { 238 if (ACPI_FAILURE(status)) {
239
237 /* Report the error, but there isn't much else we can do */ 240 /* Report the error, but there isn't much else we can do */
238 241
239 ACPI_EXCEPTION((AE_INFO, status, 242 ACPI_EXCEPTION((AE_INFO, status,