diff options
author | Lin Ming <ming.m.lin@intel.com> | 2009-05-20 23:03:29 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-05-27 00:35:51 -0400 |
commit | 3362a6badb4fe75e198885b125b21ccf846861b4 (patch) | |
tree | 2341f6b7bebd82b6c097c58a23c22c3839d9701b /drivers/acpi/acpica/utdelete.c | |
parent | c446eed6187addf9f76ee0028abed32393aef27e (diff) |
ACPICA: Region deletion: Ensure region object is removed from handler list
Prevents a possible fault when a dynamic operation region is
deleted. ACPICA BZ 507.
http://acpica.org/bugzilla/show_bug.cgi?id=507
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/utdelete.c')
-rw-r--r-- | drivers/acpi/acpica/utdelete.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c index a5ee23bc4f55..bc1710315088 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c | |||
@@ -75,6 +75,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) | |||
75 | union acpi_operand_object *handler_desc; | 75 | union acpi_operand_object *handler_desc; |
76 | union acpi_operand_object *second_desc; | 76 | union acpi_operand_object *second_desc; |
77 | union acpi_operand_object *next_desc; | 77 | union acpi_operand_object *next_desc; |
78 | union acpi_operand_object **last_obj_ptr; | ||
78 | 79 | ||
79 | ACPI_FUNCTION_TRACE_PTR(ut_delete_internal_obj, object); | 80 | ACPI_FUNCTION_TRACE_PTR(ut_delete_internal_obj, object); |
80 | 81 | ||
@@ -223,6 +224,26 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) | |||
223 | */ | 224 | */ |
224 | handler_desc = object->region.handler; | 225 | handler_desc = object->region.handler; |
225 | if (handler_desc) { | 226 | if (handler_desc) { |
227 | next_desc = | ||
228 | handler_desc->address_space.region_list; | ||
229 | last_obj_ptr = | ||
230 | &handler_desc->address_space.region_list; | ||
231 | |||
232 | /* Remove the region object from the handler's list */ | ||
233 | |||
234 | while (next_desc) { | ||
235 | if (next_desc == object) { | ||
236 | *last_obj_ptr = | ||
237 | next_desc->region.next; | ||
238 | break; | ||
239 | } | ||
240 | |||
241 | /* Walk the linked list of handler */ | ||
242 | |||
243 | last_obj_ptr = &next_desc->region.next; | ||
244 | next_desc = next_desc->region.next; | ||
245 | } | ||
246 | |||
226 | if (handler_desc->address_space.handler_flags & | 247 | if (handler_desc->address_space.handler_flags & |
227 | ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) { | 248 | ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) { |
228 | 249 | ||