From a979560bc6d1451de62b8deedfdb38b347290f38 Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Tue, 27 Apr 2010 11:46:25 +0800 Subject: [PATCH] --- yaml --- r: 193498 b: refs/heads/master c: 17b82327f3e7ab5a068f8019768008ee82d912be h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/acpi/acpica/utcopy.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 3e82141e19ad..9f3c2b278438 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3fe50208b29b2463eb6c181c1433dd1beb39f282 +refs/heads/master: 17b82327f3e7ab5a068f8019768008ee82d912be diff --git a/trunk/drivers/acpi/acpica/utcopy.c b/trunk/drivers/acpi/acpica/utcopy.c index 97ec3621e71d..6fef83f04bcd 100644 --- a/trunk/drivers/acpi/acpica/utcopy.c +++ b/trunk/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 */