Skip to content

Commit

Permalink
ACPICA: Events: Fix an issue that region object is re-attached to ano…
Browse files Browse the repository at this point in the history
…ther 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>
  • Loading branch information
Lv Zheng authored and Rafael J. Wysocki committed Jan 1, 2016
1 parent 2e1beaf commit 1d65d9a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/acpi/acpica/evregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,12 @@ acpi_ev_attach_region(union acpi_operand_object *handler_obj,

ACPI_FUNCTION_TRACE(ev_attach_region);

/* Install the region's handler */

if (region_obj->region.handler) {
return_ACPI_STATUS(AE_ALREADY_EXISTS);
}

ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
"Adding Region [%4.4s] %p to address handler %p [%s]\n",
acpi_ut_get_node_name(region_obj->region.node),
Expand All @@ -515,13 +521,6 @@ acpi_ev_attach_region(union acpi_operand_object *handler_obj,

region_obj->region.next = handler_obj->address_space.region_list;
handler_obj->address_space.region_list = region_obj;

/* Install the region's handler */

if (region_obj->region.handler) {
return_ACPI_STATUS(AE_ALREADY_EXISTS);
}

region_obj->region.handler = handler_obj;
acpi_ut_add_reference(handler_obj);

Expand Down

0 comments on commit 1d65d9a

Please sign in to comment.