Merge branch 'kvm-updates/2.6.35' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[safe/jmp/linux-2.6] / drivers / acpi / ec.c
index 3f01f06..5f2027d 100644 (file)
@@ -1037,10 +1037,9 @@ int __init acpi_ec_ecdt_probe(void)
                /* Don't trust ECDT, which comes from ASUSTek */
                if (!EC_FLAGS_VALIDATE_ECDT)
                        goto install;
-               saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
+               saved_ec = kmemdup(boot_ec, sizeof(struct acpi_ec), GFP_KERNEL);
                if (!saved_ec)
                        return -ENOMEM;
-               memcpy(saved_ec, boot_ec, sizeof(struct acpi_ec));
        /* fall through */
        }