Skip to contentSkip to conversation

ACPI: Fixes device power states array overflow

PATCH Applied Lin Ming 3 participants 3 messages Jun 1, 2011 – Jul 14, 2011

Subsystems (2)
lore
Share & tools
lore

Lin Ming

author
#0 lore raw

PATCH v2 1/1 ACPI: Fixes device power states array overflow

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.

---
 include/acpi/acpi_bus.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acpi_bus.h +1 -1
index 3a10ef5..6cd5b64 100644
@@ -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 */
Signature · 8 lines
1.7.2.3



--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 24 lines · Lin Ming

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.

---
 include/acpi/acpi_bus.h |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acpi_bus.h +0 -0
index 3a10ef5..6cd5b64 100644
@@ -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) */ };

Quoted 3 lines

 /* 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html