diff options
author | Lin Ming <ming.m.lin@intel.com> | 2009-10-12 22:34:56 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-11-24 20:30:05 -0500 |
commit | 50b77eda9b12ff0ccf12b4021b7193d71778c0a9 (patch) | |
tree | b3a72fbe73f59be9aa2a4afe5a712e1af2d1bf18 /drivers | |
parent | 74d3ec77a5e0633b0c7a8490941432c2e4789037 (diff) |
ACPICA: Fix possible memory leak for Scope ASL operator
Using Scope(\) to change the scope to the root could cause a
single object memory leak.
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/acpica/dswload.c | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c index 6de3a99d4cd4..10fc78517843 100644 --- a/drivers/acpi/acpica/dswload.c +++ b/drivers/acpi/acpica/dswload.c | |||
@@ -639,26 +639,42 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, | |||
639 | break; | 639 | break; |
640 | 640 | ||
641 | case AML_SCOPE_OP: | 641 | case AML_SCOPE_OP: |
642 | /* | 642 | |
643 | * The Path is an object reference to an existing object. | 643 | /* Special case for Scope(\) -> refers to the Root node */ |
644 | * Don't enter the name into the namespace, but look it up | 644 | |
645 | * for use later. | 645 | if (op && (op->named.node == acpi_gbl_root_node)) { |
646 | */ | 646 | node = op->named.node; |
647 | status = | 647 | |
648 | acpi_ns_lookup(walk_state->scope_info, buffer_ptr, | 648 | status = |
649 | object_type, ACPI_IMODE_EXECUTE, | 649 | acpi_ds_scope_stack_push(node, object_type, |
650 | ACPI_NS_SEARCH_PARENT, walk_state, &(node)); | 650 | walk_state); |
651 | if (ACPI_FAILURE(status)) { | 651 | if (ACPI_FAILURE(status)) { |
652 | #ifdef ACPI_ASL_COMPILER | 652 | return_ACPI_STATUS(status); |
653 | if (status == AE_NOT_FOUND) { | ||
654 | status = AE_OK; | ||
655 | } else { | ||
656 | ACPI_ERROR_NAMESPACE(buffer_ptr, status); | ||
657 | } | 653 | } |
654 | } else { | ||
655 | /* | ||
656 | * The Path is an object reference to an existing object. | ||
657 | * Don't enter the name into the namespace, but look it up | ||
658 | * for use later. | ||
659 | */ | ||
660 | status = | ||
661 | acpi_ns_lookup(walk_state->scope_info, buffer_ptr, | ||
662 | object_type, ACPI_IMODE_EXECUTE, | ||
663 | ACPI_NS_SEARCH_PARENT, walk_state, | ||
664 | &(node)); | ||
665 | if (ACPI_FAILURE(status)) { | ||
666 | #ifdef ACPI_ASL_COMPILER | ||
667 | if (status == AE_NOT_FOUND) { | ||
668 | status = AE_OK; | ||
669 | } else { | ||
670 | ACPI_ERROR_NAMESPACE(buffer_ptr, | ||
671 | status); | ||
672 | } | ||
658 | #else | 673 | #else |
659 | ACPI_ERROR_NAMESPACE(buffer_ptr, status); | 674 | ACPI_ERROR_NAMESPACE(buffer_ptr, status); |
660 | #endif | 675 | #endif |
661 | return_ACPI_STATUS(status); | 676 | return_ACPI_STATUS(status); |
677 | } | ||
662 | } | 678 | } |
663 | 679 | ||
664 | /* | 680 | /* |