diff options
author | Dana Myers <dana.myers@oracle.com> | 2011-01-11 20:09:31 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-18 23:47:41 -0500 |
commit | 5d3131f5b0ae6303d042fd91ed9147ad4ae4bf6d (patch) | |
tree | 1d2ebc9b9aa6b4644247cd230d16d889f7daf4a4 /drivers/acpi | |
parent | be33b76a974cdb4ceadc1a12fb79cc97bcfeea37 (diff) |
ACPICA: Fix namespace race condition
Fixes a race condition between method execution and namespace
walks that can possibly fault. Problem was apparently introduced
in version 20100528 as a result of a performance optimization
that reduces the number of namespace walks upon method exit
by using the delete_namespace_subtree function instead of the
delete_namespace_by_owner function used previously. Bug is in
the delete_namespace_subtree function.
Signed-off-by: Dana Myers <dana.myers@oracle.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Reviewed-by: Rafael Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/nsalloc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index 1e5ff803d9ad..222a23e838d6 100644 --- a/drivers/acpi/acpica/nsalloc.c +++ b/drivers/acpi/acpica/nsalloc.c | |||
@@ -341,6 +341,7 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) | |||
341 | { | 341 | { |
342 | struct acpi_namespace_node *child_node = NULL; | 342 | struct acpi_namespace_node *child_node = NULL; |
343 | u32 level = 1; | 343 | u32 level = 1; |
344 | acpi_status status; | ||
344 | 345 | ||
345 | ACPI_FUNCTION_TRACE(ns_delete_namespace_subtree); | 346 | ACPI_FUNCTION_TRACE(ns_delete_namespace_subtree); |
346 | 347 | ||
@@ -348,6 +349,13 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) | |||
348 | return_VOID; | 349 | return_VOID; |
349 | } | 350 | } |
350 | 351 | ||
352 | /* Lock namespace for possible update */ | ||
353 | |||
354 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); | ||
355 | if (ACPI_FAILURE(status)) { | ||
356 | return_VOID; | ||
357 | } | ||
358 | |||
351 | /* | 359 | /* |
352 | * Traverse the tree of objects until we bubble back up | 360 | * Traverse the tree of objects until we bubble back up |
353 | * to where we started. | 361 | * to where we started. |
@@ -397,6 +405,7 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) | |||
397 | } | 405 | } |
398 | } | 406 | } |
399 | 407 | ||
408 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | ||
400 | return_VOID; | 409 | return_VOID; |
401 | } | 410 | } |
402 | 411 | ||