From patchwork Thu Mar 18 14:20:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Starikovskiy X-Patchwork-Id: 86720 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 o2IEKhkj020273 for ; Thu, 18 Mar 2010 14:20:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753903Ab0CROUm (ORCPT ); Thu, 18 Mar 2010 10:20:42 -0400 Received: from nat.nue.novell.com ([195.135.221.3]:39920 "EHLO emea5-mh.id5.novell.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753804Ab0CROUm (ORCPT ); Thu, 18 Mar 2010 10:20:42 -0400 Received: from [127.0.1.1] ([149.44.162.75]) by emea5-mh.id5.novell.com with ESMTP; Thu, 18 Mar 2010 15:20:39 +0100 From: Alexey Starikovskiy To: Len Brown Cc: Linux-acpi@vger.kernel.org Subject: [PATCH] ACPICA: Do memcpy of only allocated tables. Date: Thu, 18 Mar 2010 17:20:44 +0300 Message-ID: <20100318142043.31211.11872.stgit@thinkpad> User-Agent: StGIT/0.14.2 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]); Thu, 18 Mar 2010 14:20:43 +0000 (UTC) diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index 5217a61..3cedfb3 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c @@ -194,7 +194,9 @@ acpi_status acpi_reallocate_root_table(void) return_ACPI_STATUS(AE_NO_MEMORY); } - ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, new_size); + ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, + acpi_gbl_root_table_list.count * + sizeof(struct acpi_table_desc)); acpi_gbl_root_table_list.size = acpi_gbl_root_table_list.count; acpi_gbl_root_table_list.tables = tables;