Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3362a6ba authored by Lin Ming's avatar Lin Ming Committed by Len Brown
Browse files

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: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c446eed6
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
	union acpi_operand_object *handler_desc;
	union acpi_operand_object *second_desc;
	union acpi_operand_object *next_desc;
	union acpi_operand_object **last_obj_ptr;

	ACPI_FUNCTION_TRACE_PTR(ut_delete_internal_obj, object);

@@ -223,6 +224,26 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
			 */
			handler_desc = object->region.handler;
			if (handler_desc) {
				next_desc =
				    handler_desc->address_space.region_list;
				last_obj_ptr =
				    &handler_desc->address_space.region_list;

				/* Remove the region object from the handler's list */

				while (next_desc) {
					if (next_desc == object) {
						*last_obj_ptr =
						    next_desc->region.next;
						break;
					}

					/* Walk the linked list of handler */

					last_obj_ptr = &next_desc->region.next;
					next_desc = next_desc->region.next;
				}

				if (handler_desc->address_space.handler_flags &
				    ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) {