power: fix bound on state array

Attempts to disable PM_STATE_SOFT_OFF would index past the end of the
count array.  Increase the array length to allow operations on
PM_STATE_SOFT_OFF.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2021-02-01 16:31:47 -06:00 committed by Anas Nashif
parent af5a79f6c1
commit 96dfed029d

View File

@ -15,7 +15,7 @@
#include <logging/log.h>
LOG_MODULE_DECLARE(power);
#define PM_STATES_LEN (PM_STATE_SOFT_OFF - PM_STATE_ACTIVE)
#define PM_STATES_LEN (1 + PM_STATE_SOFT_OFF - PM_STATE_ACTIVE)
static atomic_t power_state_disable_count[PM_STATES_LEN];