diff options
Diffstat (limited to 'drivers/acpi/executer/excreate.c')
-rw-r--r-- | drivers/acpi/executer/excreate.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c index 34eec82c1b1e..a4d29b2d086f 100644 --- a/drivers/acpi/executer/excreate.c +++ b/drivers/acpi/executer/excreate.c | |||
@@ -359,8 +359,9 @@ acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state) | |||
359 | union acpi_operand_object **operand = &walk_state->operands[0]; | 359 | union acpi_operand_object **operand = &walk_state->operands[0]; |
360 | union acpi_operand_object *obj_desc; | 360 | union acpi_operand_object *obj_desc; |
361 | struct acpi_namespace_node *node; | 361 | struct acpi_namespace_node *node; |
362 | struct acpi_table_header *table; | ||
363 | union acpi_operand_object *region_obj2; | 362 | union acpi_operand_object *region_obj2; |
363 | acpi_native_uint table_index; | ||
364 | struct acpi_table_header *table; | ||
364 | 365 | ||
365 | ACPI_FUNCTION_TRACE(ex_create_table_region); | 366 | ACPI_FUNCTION_TRACE(ex_create_table_region); |
366 | 367 | ||
@@ -380,7 +381,7 @@ acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state) | |||
380 | 381 | ||
381 | status = acpi_tb_find_table(operand[1]->string.pointer, | 382 | status = acpi_tb_find_table(operand[1]->string.pointer, |
382 | operand[2]->string.pointer, | 383 | operand[2]->string.pointer, |
383 | operand[3]->string.pointer, &table); | 384 | operand[3]->string.pointer, &table_index); |
384 | if (ACPI_FAILURE(status)) { | 385 | if (ACPI_FAILURE(status)) { |
385 | return_ACPI_STATUS(status); | 386 | return_ACPI_STATUS(status); |
386 | } | 387 | } |
@@ -395,6 +396,11 @@ acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state) | |||
395 | region_obj2 = obj_desc->common.next_object; | 396 | region_obj2 = obj_desc->common.next_object; |
396 | region_obj2->extra.region_context = NULL; | 397 | region_obj2->extra.region_context = NULL; |
397 | 398 | ||
399 | status = acpi_get_table_by_index(table_index, &table); | ||
400 | if (ACPI_FAILURE(status)) { | ||
401 | return_ACPI_STATUS(status); | ||
402 | } | ||
403 | |||
398 | /* Init the region from the operands */ | 404 | /* Init the region from the operands */ |
399 | 405 | ||
400 | obj_desc->region.space_id = REGION_DATA_TABLE; | 406 | obj_desc->region.space_id = REGION_DATA_TABLE; |
@@ -553,7 +559,8 @@ acpi_ex_create_method(u8 * aml_start, | |||
553 | 559 | ||
554 | obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_METHOD); | 560 | obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_METHOD); |
555 | if (!obj_desc) { | 561 | if (!obj_desc) { |
556 | return_ACPI_STATUS(AE_NO_MEMORY); | 562 | status = AE_NO_MEMORY; |
563 | goto exit; | ||
557 | } | 564 | } |
558 | 565 | ||
559 | /* Save the method's AML pointer and length */ | 566 | /* Save the method's AML pointer and length */ |
@@ -597,6 +604,7 @@ acpi_ex_create_method(u8 * aml_start, | |||
597 | 604 | ||
598 | acpi_ut_remove_reference(obj_desc); | 605 | acpi_ut_remove_reference(obj_desc); |
599 | 606 | ||
607 | exit: | ||
600 | /* Remove a reference to the operand */ | 608 | /* Remove a reference to the operand */ |
601 | 609 | ||
602 | acpi_ut_remove_reference(operand[1]); | 610 | acpi_ut_remove_reference(operand[1]); |