Commit 6f02073d authored by David E. Box's avatar David E. Box Committed by Greg Kroah-Hartman

ACPICA: Namespace: Properly null terminate objects detached from a namespace node

commit e23d9b82 upstream.

Fixes a bug exposed by an ACPICA unit test around the
acpi_attach_data()/acpi_detach_data() APIs where the failure to null
terminate a detached object led to the creation of a circular linked list
(and infinite looping) when the object is reattached.

Reported in acpica bugzilla #1063

Link: https://bugs.acpica.org/show_bug.cgi?id=1063Signed-off-by: default avatarDavid E. Box <david.e.box@linux.intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e2ab6731
......@@ -239,6 +239,17 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node)
}
}
/*
* Detach the object from any data objects (which are still held by
* the namespace node)
*/
if (obj_desc->common.next_object &&
((obj_desc->common.next_object)->common.type ==
ACPI_TYPE_LOCAL_DATA)) {
obj_desc->common.next_object = NULL;
}
/* Reset the node type to untyped */
node->type = ACPI_TYPE_ANY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment