diff options
author | Lv Zheng <lv.zheng@intel.com> | 2015-12-29 01:02:50 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-12-31 21:47:38 -0500 |
commit | 1d65d9a7b642b8d1eb201830e0c1cae6231b5c51 (patch) | |
tree | 10aa28197b4dea8ecc6f01c33ef16c29ced6e086 | |
parent | 2e1beaf6a91998ad82e11a4c5a7b55b59396983b (diff) |
ACPICA: Events: Fix an issue that region object is re-attached to another scope when it is already attached
ACPICA commit 6ebcb24d3225b6c7715a3ce061c327b4c3a6b76e
The logic in acpi_ev_attach_region() is not correct, it can break address
space handler link. This patch fixes this problem. But be aware that this
fix must be applied along with a region object race issue fix. Lv Zheng.
Link: https://github.com/acpica/acpica/commit/6ebcb24d
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/acpica/evregion.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c index 6717e57604d3..19a4e695555f 100644 --- a/drivers/acpi/acpica/evregion.c +++ b/drivers/acpi/acpica/evregion.c | |||
@@ -504,6 +504,12 @@ acpi_ev_attach_region(union acpi_operand_object *handler_obj, | |||
504 | 504 | ||
505 | ACPI_FUNCTION_TRACE(ev_attach_region); | 505 | ACPI_FUNCTION_TRACE(ev_attach_region); |
506 | 506 | ||
507 | /* Install the region's handler */ | ||
508 | |||
509 | if (region_obj->region.handler) { | ||
510 | return_ACPI_STATUS(AE_ALREADY_EXISTS); | ||
511 | } | ||
512 | |||
507 | ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, | 513 | ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, |
508 | "Adding Region [%4.4s] %p to address handler %p [%s]\n", | 514 | "Adding Region [%4.4s] %p to address handler %p [%s]\n", |
509 | acpi_ut_get_node_name(region_obj->region.node), | 515 | acpi_ut_get_node_name(region_obj->region.node), |
@@ -515,13 +521,6 @@ acpi_ev_attach_region(union acpi_operand_object *handler_obj, | |||
515 | 521 | ||
516 | region_obj->region.next = handler_obj->address_space.region_list; | 522 | region_obj->region.next = handler_obj->address_space.region_list; |
517 | handler_obj->address_space.region_list = region_obj; | 523 | handler_obj->address_space.region_list = region_obj; |
518 | |||
519 | /* Install the region's handler */ | ||
520 | |||
521 | if (region_obj->region.handler) { | ||
522 | return_ACPI_STATUS(AE_ALREADY_EXISTS); | ||
523 | } | ||
524 | |||
525 | region_obj->region.handler = handler_obj; | 524 | region_obj->region.handler = handler_obj; |
526 | acpi_ut_add_reference(handler_obj); | 525 | acpi_ut_add_reference(handler_obj); |
527 | 526 | ||