summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/dsmethod.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/dsmethod.c')
-rw-r--r--drivers/acpi/acpica/dsmethod.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 2a9a561c2f01..d94dd8974b55 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -573,7 +573,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
acpi_os_release_mutex(method_desc->method.
mutex->mutex.os_mutex);
- method_desc->method.mutex->mutex.thread_id = NULL;
+ method_desc->method.mutex->mutex.thread_id = 0;
}
}
@@ -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);
+ }
}
}
@@ -605,7 +619,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
* we immediately reuse it for the next thread executing this method
*/
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
- "*** Completed execution of one thread, %d threads remaining\n",
+ "*** Completed execution of one thread, %u threads remaining\n",
method_desc->method.thread_count));
} else {
/* This is the only executing thread for this method */