rtos/FreeRTOS: Fix FreeRTOS thread list reading

Change-Id: I749ae94ec7279907b1905c02ecc1e9661f43ef70
Signed-off-by: Rahul Masurkar <rahulgm@marvell.com>
Reviewed-on: http://openocd.zylin.com/5273
Tested-by: jenkins
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Rahul Masurkar 2019-08-06 18:19:07 +05:30 committed by Tomas Vanek
parent bb1c7ae4ae
commit 6568d29cc1

View File

@ -263,14 +263,14 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
symbol_address_t *list_of_lists =
malloc(sizeof(symbol_address_t) *
(max_used_priority+1 + 5));
(max_used_priority + 5));
if (!list_of_lists) {
LOG_ERROR("Error allocating memory for %" PRId64 " priorities", max_used_priority);
return ERROR_FAIL;
}
int num_lists;
for (num_lists = 0; num_lists <= max_used_priority; num_lists++)
for (num_lists = 0; num_lists < max_used_priority; num_lists++)
list_of_lists[num_lists] = rtos->symbols[FreeRTOS_VAL_pxReadyTasksLists].address +
num_lists * param->list_width;