From patchwork Sat May 15 21:16:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 99880 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4FLHVZB015319 for ; Sat, 15 May 2010 21:17:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755052Ab0EOVQ3 (ORCPT ); Sat, 15 May 2010 17:16:29 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:41696 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754731Ab0EOVQ1 (ORCPT ); Sat, 15 May 2010 17:16:27 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id 2D4A719BB6D; Sat, 15 May 2010 23:16:27 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08095-09; Sat, 15 May 2010 23:16:22 +0200 (CEST) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw2.diku.dk (Postfix) with ESMTP id 2078F19BB3C; Sat, 15 May 2010 23:16:22 +0200 (CEST) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 9BDF06DFD0B; Sat, 15 May 2010 23:09:10 +0200 (CEST) Received: by ask.diku.dk (Postfix, from userid 3767) id 02D8B200BE; Sat, 15 May 2010 23:16:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id EB129200BC; Sat, 15 May 2010 23:16:21 +0200 (CEST) Date: Sat, 15 May 2010 23:16:21 +0200 (CEST) From: Julia Lawall To: Alexey Starikovskiy , Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 11/37] drivers/acpi: Use kmemdup Message-ID: MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 15 May 2010 21:17:31 +0000 (UTC) diff -u -p a/drivers/acpi/ec.c b/drivers/acpi/ec.c --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1027,10 +1027,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 */ }