Merge branches 'bugzilla-14668' and 'misc-2.6.35' into release
[platform/adaptation/renesas_rcar/renesas_kernel.git] / 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 */
        }