From 1655620c0cbd4f6fabf04df087f277eb106500f8 Mon Sep 17 00:00:00 2001 From: Chao Du Date: Fri, 17 Feb 2023 07:43:13 +0000 Subject: [PATCH] Set the current_thread when no FreeRTOS task was created. The 'current thread' was not set when no FreeRTOS task created. Which could lead a wrongly invoking of freertos_get_thread_reg_list. Change-Id: I0e0f8327080ef698d7ed4aae5ac2a630d532ddeb Signed-off-by: Chao Du --- src/rtos/FreeRTOS.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rtos/FreeRTOS.c b/src/rtos/FreeRTOS.c index 96b535d7c..e017c579f 100644 --- a/src/rtos/FreeRTOS.c +++ b/src/rtos/FreeRTOS.c @@ -501,6 +501,7 @@ static int freertos_update_threads(struct rtos *rtos) LOG_ERROR("Error allocating memory for %" PRIu64 " threads", thread_list_size); return ERROR_FAIL; } + rtos->current_thread = 1; rtos->thread_details->threadid = 1; rtos->thread_details->exists = true; rtos->thread_details->extra_info_str = NULL;