From patchwork Wed Jun 1 15:54:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lin Ming X-Patchwork-Id: 840502 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p51Espfw005818 for ; Wed, 1 Jun 2011 14:54:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757574Ab1FAOyk (ORCPT ); Wed, 1 Jun 2011 10:54:40 -0400 Received: from mga14.intel.com ([143.182.124.37]:34432 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757412Ab1FAOyi (ORCPT ); Wed, 1 Jun 2011 10:54:38 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 01 Jun 2011 07:54:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,303,1304319600"; d="scan'208";a="5250689" Received: from unknown (HELO [10.255.20.176]) ([10.255.20.176]) by azsmga001.ch.intel.com with ESMTP; 01 Jun 2011 07:54:35 -0700 Subject: [PATCH v2] ACPI: Fixes device power states array overflow From: Lin Ming To: Len Brown Cc: linux-acpi@vger.kernel.org, Dan Carpenter , Old Date: Wed, 01 Jun 2011 23:54:02 +0800 Message-ID: <1306943642.2873.10.camel@hp6530s> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 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.6 (demeter2.kernel.org [140.211.167.43]); Wed, 01 Jun 2011 14:54:52 +0000 (UTC) Commit 28c2103 added new state ACPI_STATE_D3_COLD, so the device power states array must be expanded by one also. v2: Use ACPI_D_STATE_COUNT instead of number 5 for the array size. Reported-by: Dan Carpenter Suggested-by: Old?ich Jedli?ka Signed-off-by: Lin Ming --- include/acpi/acpi_bus.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 3a10ef5..6cd5b64 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -210,7 +210,7 @@ struct acpi_device_power_state { struct acpi_device_power { int state; /* Current state */ struct acpi_device_power_flags flags; - struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ + struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */ }; /* Performance Management */