diff options
Diffstat (limited to 'drivers/acpi/executer/exoparg1.c')
-rw-r--r-- | drivers/acpi/executer/exoparg1.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c index dbdf8262ba00..48c30f800083 100644 --- a/drivers/acpi/executer/exoparg1.c +++ b/drivers/acpi/executer/exoparg1.c | |||
@@ -113,8 +113,9 @@ acpi_ex_opcode_0A_0T_1R ( | |||
113 | status = AE_NO_MEMORY; | 113 | status = AE_NO_MEMORY; |
114 | goto cleanup; | 114 | goto cleanup; |
115 | } | 115 | } |
116 | 116 | #if ACPI_MACHINE_WIDTH != 16 | |
117 | return_desc->integer.value = acpi_os_get_timer (); | 117 | return_desc->integer.value = acpi_os_get_timer (); |
118 | #endif | ||
118 | break; | 119 | break; |
119 | 120 | ||
120 | default: /* Unknown opcode */ | 121 | default: /* Unknown opcode */ |
@@ -127,15 +128,16 @@ acpi_ex_opcode_0A_0T_1R ( | |||
127 | 128 | ||
128 | cleanup: | 129 | cleanup: |
129 | 130 | ||
130 | if (!walk_state->result_obj) { | ||
131 | walk_state->result_obj = return_desc; | ||
132 | } | ||
133 | |||
134 | /* Delete return object on error */ | 131 | /* Delete return object on error */ |
135 | 132 | ||
136 | if (ACPI_FAILURE (status)) { | 133 | if ((ACPI_FAILURE (status)) || walk_state->result_obj) { |
137 | acpi_ut_remove_reference (return_desc); | 134 | acpi_ut_remove_reference (return_desc); |
138 | } | 135 | } |
136 | else { | ||
137 | /* Save the return value */ | ||
138 | |||
139 | walk_state->result_obj = return_desc; | ||
140 | } | ||
139 | 141 | ||
140 | return_ACPI_STATUS (status); | 142 | return_ACPI_STATUS (status); |
141 | } | 143 | } |
@@ -902,6 +904,7 @@ acpi_ex_opcode_1A_0T_1R ( | |||
902 | */ | 904 | */ |
903 | return_desc = acpi_ns_get_attached_object ( | 905 | return_desc = acpi_ns_get_attached_object ( |
904 | (struct acpi_namespace_node *) operand[0]); | 906 | (struct acpi_namespace_node *) operand[0]); |
907 | acpi_ut_add_reference (return_desc); | ||
905 | } | 908 | } |
906 | else { | 909 | else { |
907 | /* | 910 | /* |
@@ -951,20 +954,10 @@ acpi_ex_opcode_1A_0T_1R ( | |||
951 | * add another reference to the referenced object, however. | 954 | * add another reference to the referenced object, however. |
952 | */ | 955 | */ |
953 | return_desc = *(operand[0]->reference.where); | 956 | return_desc = *(operand[0]->reference.where); |
954 | if (!return_desc) { | 957 | if (return_desc) { |
955 | /* | 958 | acpi_ut_add_reference (return_desc); |
956 | * We can't return a NULL dereferenced value. This is | ||
957 | * an uninitialized package element and is thus a | ||
958 | * severe error. | ||
959 | */ | ||
960 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, | ||
961 | "NULL package element obj %p\n", | ||
962 | operand[0])); | ||
963 | status = AE_AML_UNINITIALIZED_ELEMENT; | ||
964 | goto cleanup; | ||
965 | } | 959 | } |
966 | 960 | ||
967 | acpi_ut_add_reference (return_desc); | ||
968 | break; | 961 | break; |
969 | 962 | ||
970 | 963 | ||