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:
parent
af5a79f6c1
commit
96dfed029d
@ -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];
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user