From 3a57a8060ec88e9ca571b8d83bc00d0a53007673 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Fri, 14 Jan 2022 22:46:41 -0800 Subject: [PATCH] tests: pm_multicore: Avoid possible race condition Use the given cpu argument in the policy callback to avoid possible race condition. Signed-off-by: Flavio Ceolin --- tests/subsys/pm/power_mgmt_multicore/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/subsys/pm/power_mgmt_multicore/src/main.c b/tests/subsys/pm/power_mgmt_multicore/src/main.c index 8d6f7e1073f..8ff4b0e0155 100644 --- a/tests/subsys/pm/power_mgmt_multicore/src/main.c +++ b/tests/subsys/pm/power_mgmt_multicore/src/main.c @@ -79,7 +79,7 @@ const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int ticks) } } - state_testing[_current_cpu->id] = info.state; + state_testing[cpu] = info.state; return &info; }