diff mbox

[v2] ACPI: Fixes device power states array overflow

Message ID 1306943642.2873.10.camel@hp6530s (mailing list archive)
State New, archived
Headers show

Commit Message

Lin Ming June 1, 2011, 3:54 p.m. 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 <error27@gmail.com>
Suggested-by: Old?ich Jedli?ka <oldium.pro@seznam.cz>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---
 include/acpi/acpi_bus.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Ming Lin June 14, 2011, 2:53 a.m. UTC | #1
On Wed, Jun 1, 2011 at 11:54 PM, Lin Ming <ming.m.lin@intel.com> wrote:
> 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 <error27@gmail.com>
> Suggested-by: Old?ich Jedli?ka <oldium.pro@seznam.cz>
> Signed-off-by: Lin Ming <ming.m.lin@intel.com>
> ---
>  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 */
> --
> 1.7.2.3

Len,

Would you apply this one?

Thanks,
Lin Ming
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Len Brown July 14, 2011, 3:54 a.m. UTC | #2
applied

thanks,
Len Brown, Intel Open Source Technology Center

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 */