diff options
Diffstat (limited to 'drivers/acpi/dispatcher/dsopcode.c')
-rw-r--r-- | drivers/acpi/dispatcher/dsopcode.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c index ba13bca28bee..750bdb1ac344 100644 --- a/drivers/acpi/dispatcher/dsopcode.c +++ b/drivers/acpi/dispatcher/dsopcode.c | |||
@@ -119,14 +119,15 @@ acpi_ds_execute_arguments ( | |||
119 | 119 | ||
120 | walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL); | 120 | walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL); |
121 | if (!walk_state) { | 121 | if (!walk_state) { |
122 | return_ACPI_STATUS (AE_NO_MEMORY); | 122 | status = AE_NO_MEMORY; |
123 | goto cleanup; | ||
123 | } | 124 | } |
124 | 125 | ||
125 | status = acpi_ds_init_aml_walk (walk_state, op, NULL, aml_start, | 126 | status = acpi_ds_init_aml_walk (walk_state, op, NULL, aml_start, |
126 | aml_length, NULL, 1); | 127 | aml_length, NULL, 1); |
127 | if (ACPI_FAILURE (status)) { | 128 | if (ACPI_FAILURE (status)) { |
128 | acpi_ds_delete_walk_state (walk_state); | 129 | acpi_ds_delete_walk_state (walk_state); |
129 | return_ACPI_STATUS (status); | 130 | goto cleanup; |
130 | } | 131 | } |
131 | 132 | ||
132 | /* Mark this parse as a deferred opcode */ | 133 | /* Mark this parse as a deferred opcode */ |
@@ -138,8 +139,7 @@ acpi_ds_execute_arguments ( | |||
138 | 139 | ||
139 | status = acpi_ps_parse_aml (walk_state); | 140 | status = acpi_ps_parse_aml (walk_state); |
140 | if (ACPI_FAILURE (status)) { | 141 | if (ACPI_FAILURE (status)) { |
141 | acpi_ps_delete_parse_tree (op); | 142 | goto cleanup; |
142 | return_ACPI_STATUS (status); | ||
143 | } | 143 | } |
144 | 144 | ||
145 | /* Get and init the Op created above */ | 145 | /* Get and init the Op created above */ |
@@ -160,7 +160,8 @@ acpi_ds_execute_arguments ( | |||
160 | 160 | ||
161 | walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL); | 161 | walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL); |
162 | if (!walk_state) { | 162 | if (!walk_state) { |
163 | return_ACPI_STATUS (AE_NO_MEMORY); | 163 | status = AE_NO_MEMORY; |
164 | goto cleanup; | ||
164 | } | 165 | } |
165 | 166 | ||
166 | /* Execute the opcode and arguments */ | 167 | /* Execute the opcode and arguments */ |
@@ -169,13 +170,15 @@ acpi_ds_execute_arguments ( | |||
169 | aml_length, NULL, 3); | 170 | aml_length, NULL, 3); |
170 | if (ACPI_FAILURE (status)) { | 171 | if (ACPI_FAILURE (status)) { |
171 | acpi_ds_delete_walk_state (walk_state); | 172 | acpi_ds_delete_walk_state (walk_state); |
172 | return_ACPI_STATUS (status); | 173 | goto cleanup; |
173 | } | 174 | } |
174 | 175 | ||
175 | /* Mark this execution as a deferred opcode */ | 176 | /* Mark this execution as a deferred opcode */ |
176 | 177 | ||
177 | walk_state->deferred_node = node; | 178 | walk_state->deferred_node = node; |
178 | status = acpi_ps_parse_aml (walk_state); | 179 | status = acpi_ps_parse_aml (walk_state); |
180 | |||
181 | cleanup: | ||
179 | acpi_ps_delete_parse_tree (op); | 182 | acpi_ps_delete_parse_tree (op); |
180 | return_ACPI_STATUS (status); | 183 | return_ACPI_STATUS (status); |
181 | } | 184 | } |