aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/executer/exoparg1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/executer/exoparg1.c')
-rw-r--r--drivers/acpi/executer/exoparg1.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index dbdf8262ba0..ffc61ddeb65 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -127,15 +127,16 @@ acpi_ex_opcode_0A_0T_1R (
cleanup:
- if (!walk_state->result_obj) {
- walk_state->result_obj = return_desc;
- }
-
/* Delete return object on error */
- if (ACPI_FAILURE (status)) {
+ if ((ACPI_FAILURE (status)) || walk_state->result_obj) {
acpi_ut_remove_reference (return_desc);
}
+ else {
+ /* Save the return value */
+
+ walk_state->result_obj = return_desc;
+ }
return_ACPI_STATUS (status);
}