aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid E. Box <david.e.box@linux.intel.com>2014-07-07 22:06:24 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-08 08:22:25 -0400
commite23d9b8297546c6ceb7e70771e4915f2a41733cd (patch)
tree1abe5f05beea0d796157fdfe4036c47cc526be38
parentce5eb07339b9162812458ee611b6e7af7604a3e4 (diff)
ACPICA: Namespace: Properly null terminate objects detached from a namespace node
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=1063 Signed-off-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: 3.15+ <stable@vger.kernel.org> # 3.15+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/nsobject.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/nsobject.c b/drivers/acpi/acpica/nsobject.c
index fe54a8c73b8c..f1ea8e56cd87 100644
--- a/drivers/acpi/acpica/nsobject.c
+++ b/drivers/acpi/acpica/nsobject.c
@@ -239,6 +239,17 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node)
239 } 239 }
240 } 240 }
241 241
242 /*
243 * Detach the object from any data objects (which are still held by
244 * the namespace node)
245 */
246
247 if (obj_desc->common.next_object &&
248 ((obj_desc->common.next_object)->common.type ==
249 ACPI_TYPE_LOCAL_DATA)) {
250 obj_desc->common.next_object = NULL;
251 }
252
242 /* Reset the node type to untyped */ 253 /* Reset the node type to untyped */
243 254
244 node->type = ACPI_TYPE_ANY; 255 node->type = ACPI_TYPE_ANY;