Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

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>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by

Lin Ming and committed by
Len Brown
b4a03b9a 8d86e5f9

+1 -1
+1 -1
include/acpi/acpi_bus.h
··· 210 210 struct acpi_device_power { 211 211 int state; /* Current state */ 212 212 struct acpi_device_power_flags flags; 213 - struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ 213 + struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */ 214 214 }; 215 215 216 216 /* Performance Management */