|
From: openocd-gerrit <ope...@us...> - 2023-04-07 21:45:14
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 41037eb26585114209c3c8f1d63f7788a421df07 (commit)
from 99ec5760961d264599a9c9fb1a4d5d6042bc3ba8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 41037eb26585114209c3c8f1d63f7788a421df07
Author: Chao Du <du...@es...>
Date: Wed Mar 22 06:51:51 2023 +0000
rtos/FreeRTOS: some optimization of freertos_update_threads()
1.
update the rtos->thread_count in time, to make sure the allocated
thread_name_str and extra_info_str could be freed by
rtos_free_threadlist(). Otherwise the abnormal return may cause a
memory leak.
2.
remove a redundant assignment to threadid.
Signed-off-by: Chao Du <du...@es...>
Change-Id: Ifabc59d501c925b3d6aec8b04b2856d2c31cc4e2
Reviewed-on: https://review.openocd.org/c/openocd/+/7549
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/rtos/FreeRTOS.c b/src/rtos/FreeRTOS.c
index 070275f2c..e8df030aa 100644
--- a/src/rtos/FreeRTOS.c
+++ b/src/rtos/FreeRTOS.c
@@ -312,7 +312,6 @@ static int freertos_update_threads(struct rtos *rtos)
(list_elem_ptr != prev_list_elem_ptr) &&
(tasks_found < thread_list_size)) {
/* Get the location of the thread structure. */
- rtos->thread_details[tasks_found].threadid = 0;
retval = target_read_u32(rtos->target,
list_elem_ptr + param->list_elem_content_offset,
&pointer_casts_are_bad);
@@ -365,6 +364,7 @@ static int freertos_update_threads(struct rtos *rtos)
tasks_found++;
list_thread_count--;
+ rtos->thread_count = tasks_found;
prev_list_elem_ptr = list_elem_ptr;
list_elem_ptr = 0;
@@ -383,7 +383,6 @@ static int freertos_update_threads(struct rtos *rtos)
}
free(list_of_lists);
- rtos->thread_count = tasks_found;
return 0;
}
-----------------------------------------------------------------------
Summary of changes:
src/rtos/FreeRTOS.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|