From 1d25bf865960399e3a46438fba412bab1ac1578f Mon Sep 17 00:00:00 2001 From: Alexey Starikovskiy Date: Wed, 26 May 2010 13:59:51 +0800 Subject: [PATCH] --- yaml --- r: 206754 b: refs/heads/master c: a9fc03125ea0001ff18bc29da9539b587fdbd1d7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/acpi/acpica/dsmethod.c | 18 ++++++++++++++++-- trunk/drivers/acpi/acpica/nsalloc.c | 20 ++++++++++++++++---- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 2fe0d2f5cf46..dffe879d0a8e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 20d33aea7ae7ad858f3f91c834d9043cd8122d38 +refs/heads/master: a9fc03125ea0001ff18bc29da9539b587fdbd1d7 diff --git a/trunk/drivers/acpi/acpica/dsmethod.c b/trunk/drivers/acpi/acpica/dsmethod.c index 00846333773e..64750ee96e20 100644 --- a/trunk/drivers/acpi/acpica/dsmethod.c +++ b/trunk/drivers/acpi/acpica/dsmethod.c @@ -584,8 +584,22 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, * want make the objects permanent. */ if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) { - acpi_ns_delete_namespace_by_owner(method_desc->method. - owner_id); + + /* Delete any direct children of (created by) this method */ + + acpi_ns_delete_namespace_subtree(walk_state-> + method_node); + + /* + * Delete any objects that were created by this method + * elsewhere in the namespace (if any were created). + */ + if (method_desc->method. + flags & AOPOBJ_MODIFIED_NAMESPACE) { + acpi_ns_delete_namespace_by_owner(method_desc-> + method. + owner_id); + } } } diff --git a/trunk/drivers/acpi/acpica/nsalloc.c b/trunk/drivers/acpi/acpica/nsalloc.c index 8d3a43a061ab..1e5ff803d9ad 100644 --- a/trunk/drivers/acpi/acpica/nsalloc.c +++ b/trunk/drivers/acpi/acpica/nsalloc.c @@ -219,12 +219,24 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp ACPI_FUNCTION_TRACE(ns_install_node); - /* - * Get the owner ID from the Walk state. The owner ID is used to track - * table deletion and deletion of objects created by methods. - */ if (walk_state) { + /* + * Get the owner ID from the Walk state. The owner ID is used to + * track table deletion and deletion of objects created by methods. + */ owner_id = walk_state->owner_id; + + if ((walk_state->method_desc) && + (parent_node != walk_state->method_node)) { + /* + * A method is creating a new node that is not a child of the + * method (it is non-local). Mark the executing method as having + * modified the namespace. This is used for cleanup when the + * method exits. + */ + walk_state->method_desc->method.flags |= + AOPOBJ_MODIFIED_NAMESPACE; + } } /* Link the new entry into the parent and existing children */