From d2edfa23471ed36d2f9c7499d6f220d0b8328fa5 Mon Sep 17 00:00:00 2001 From: Vincent Wan Date: Tue, 17 Sep 2019 14:47:50 -0700 Subject: [PATCH] tests: fatal: allocate timer outside of stack In stack_sentinel_timer(), the timer should not be allocated on the stack. If it gets added to the list of timeouts by k_timer_start, then an unexpected exception may occur when the timer expires since it may have been overwritten. Signed-off-by: Vincent Wan --- tests/kernel/fatal/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kernel/fatal/src/main.c b/tests/kernel/fatal/src/main.c index e85b8d9cfd5..b6f6922c70c 100644 --- a/tests/kernel/fatal/src/main.c +++ b/tests/kernel/fatal/src/main.c @@ -171,7 +171,7 @@ void stack_sentinel_timer(void) * k_timer and spin until we die. Spinning alone won't work * on a tickless kernel. */ - struct k_timer timer; + static struct k_timer timer; blow_up_stack(); k_timer_init(&timer, NULL, NULL);