summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/utcopy.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2010-06-02 02:53:36 (GMT)
committerLen Brown <len.brown@intel.com>2010-06-02 02:53:36 (GMT)
commitb42f5b0f0fd8c1c442c1b29a3fbcb338e8bd7732 (patch)
tree194e13dfa85d2d2af8bd125acd80a445ee0def62 /drivers/acpi/acpica/utcopy.c
parentfe955682d2153b35dffcf1673dff0491096a3f0a (diff)
parent0a76a34ff0804f1f413807b2e2d12117c2b602ca (diff)
downloadlinux-b42f5b0f0fd8c1c442c1b29a3fbcb338e8bd7732.tar.xz
Merge branches 'bugzilla-14668' and 'misc-2.6.35' into release
Diffstat (limited to 'drivers/acpi/acpica/utcopy.c')
-rw-r--r--drivers/acpi/acpica/utcopy.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c
index 97ec362..6fef83f 100644
--- a/drivers/acpi/acpica/utcopy.c
+++ b/drivers/acpi/acpica/utcopy.c
@@ -677,16 +677,24 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
u16 reference_count;
union acpi_operand_object *next_object;
acpi_status status;
+ acpi_size copy_size;
/* Save fields from destination that we don't want to overwrite */
reference_count = dest_desc->common.reference_count;
next_object = dest_desc->common.next_object;
- /* Copy the entire source object over the destination object */
+ /*
+ * Copy the entire source object over the destination object.
+ * Note: Source can be either an operand object or namespace node.
+ */
+ copy_size = sizeof(union acpi_operand_object);
+ if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_NAMED) {
+ copy_size = sizeof(struct acpi_namespace_node);
+ }
- ACPI_MEMCPY((char *)dest_desc, (char *)source_desc,
- sizeof(union acpi_operand_object));
+ ACPI_MEMCPY(ACPI_CAST_PTR(char, dest_desc),
+ ACPI_CAST_PTR(char, source_desc), copy_size);
/* Restore the saved fields */