These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / acpi / acpica / exresolv.c
index b6b7f3a..a1afe1a 100644 (file)
@@ -209,7 +209,6 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
                                         * (i.e., dereference the package index)
                                         * Delete the ref object, increment the returned object
                                         */
-                                       acpi_ut_remove_reference(stack_desc);
                                        acpi_ut_add_reference(obj_desc);
                                        *stack_ptr = obj_desc;
                                } else {
@@ -337,8 +336,9 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
                         acpi_object_type * return_type,
                         union acpi_operand_object **return_desc)
 {
-       union acpi_operand_object *obj_desc = (void *)operand;
-       struct acpi_namespace_node *node;
+       union acpi_operand_object *obj_desc = ACPI_CAST_PTR(void, operand);
+       struct acpi_namespace_node *node =
+           ACPI_CAST_PTR(struct acpi_namespace_node, operand);
        acpi_object_type type;
        acpi_status status;
 
@@ -355,9 +355,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
        case ACPI_DESC_TYPE_NAMED:
 
                type = ((struct acpi_namespace_node *)obj_desc)->type;
-               obj_desc =
-                   acpi_ns_get_attached_object((struct acpi_namespace_node *)
-                                               obj_desc);
+               obj_desc = acpi_ns_get_attached_object(node);
 
                /* If we had an Alias node, use the attached object for type info */
 
@@ -368,6 +366,13 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
                                                         acpi_namespace_node *)
                                                        obj_desc);
                }
+
+               if (!obj_desc) {
+                       ACPI_ERROR((AE_INFO,
+                                   "[%4.4s] Node is unresolved or uninitialized",
+                                   acpi_ut_get_node_name(node)));
+                       return_ACPI_STATUS(AE_AML_UNINITIALIZED_NODE);
+               }
                break;
 
        default: