| .. | .. |
|---|
| 517 | 517 | info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info)); |
|---|
| 518 | 518 | if (!info) { |
|---|
| 519 | 519 | status = AE_NO_MEMORY; |
|---|
| 520 | | - goto cleanup; |
|---|
| 520 | + goto pop_walk_state; |
|---|
| 521 | 521 | } |
|---|
| 522 | 522 | |
|---|
| 523 | 523 | info->parameters = &this_walk_state->operands[0]; |
|---|
| .. | .. |
|---|
| 529 | 529 | |
|---|
| 530 | 530 | ACPI_FREE(info); |
|---|
| 531 | 531 | if (ACPI_FAILURE(status)) { |
|---|
| 532 | | - goto cleanup; |
|---|
| 532 | + goto pop_walk_state; |
|---|
| 533 | 533 | } |
|---|
| 534 | 534 | |
|---|
| 535 | 535 | next_walk_state->method_nesting_depth = |
|---|
| .. | .. |
|---|
| 575 | 575 | |
|---|
| 576 | 576 | return_ACPI_STATUS(status); |
|---|
| 577 | 577 | |
|---|
| 578 | +pop_walk_state: |
|---|
| 579 | + |
|---|
| 580 | + /* On error, pop the walk state to be deleted from thread */ |
|---|
| 581 | + |
|---|
| 582 | + acpi_ds_pop_walk_state(thread); |
|---|
| 583 | + |
|---|
| 578 | 584 | cleanup: |
|---|
| 579 | 585 | |
|---|
| 580 | 586 | /* On error, we must terminate the method properly */ |
|---|