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 <vincent.wan@linaro.org>
This commit is contained in:
Vincent Wan 2019-09-17 14:47:50 -07:00 committed by Andrew Boie
commit d2edfa2347

View file

@ -171,7 +171,7 @@ void stack_sentinel_timer(void)
* k_timer and spin until we die. Spinning alone won't work * k_timer and spin until we die. Spinning alone won't work
* on a tickless kernel. * on a tickless kernel.
*/ */
struct k_timer timer; static struct k_timer timer;
blow_up_stack(); blow_up_stack();
k_timer_init(&timer, NULL, NULL); k_timer_init(&timer, NULL, NULL);