ACPICA: Fix a regression for deletion of Alias() objects.
authorBob Moore <robert.moore@intel.com>
Wed, 9 Jul 2014 00:25:45 +0000 (08:25 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 9 Jul 2014 15:55:49 +0000 (17:55 +0200)
Fixes a regression introduced by commit e23d9b829754 (ACPICA:
Namespace: Properly null terminate objects detached from a namespace
node)

In the case of Alias namespace nodes, the node simply points to the aliased
node via the Object field; thus we cannot assume that the object is an
operand object.

Fixes: e23d9b829754 (ACPICA: Namespace: Properly null terminate objects detached from a namespace node)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/nsobject.c

index f1ea8e56cd87b130dbde5953d07dd12628c34fab..a42ee9d6970d727733cc260912352f56ba89cd22 100644 (file)
@@ -237,17 +237,16 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node)
                    (node->object->common.type != ACPI_TYPE_LOCAL_DATA)) {
                        node->object = node->object->common.next_object;
                }
-       }
 
-       /*
-        * 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;
+               /*
+                * 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 */