From b82097aecce67cd2197997fa1c2002d7e7d707bb Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Mon, 12 Aug 2024 16:31:53 +0200 Subject: [PATCH] fix(freertos-smp): Prevent run state change check before TCB is created This commit prevents the run state change check to happen before a TCB has been created. --- tasks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.c b/tasks.c index 30469f1e65a..5b635f0b14a 100644 --- a/tasks.c +++ b/tasks.c @@ -879,7 +879,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; * so this is safe. */ pxThisTCB = pxCurrentTCBs[ portGET_CORE_ID() ]; - while( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD ) + while( pxThisTCB && ( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD ) ) { #if ( portUSING_GRANULAR_LOCKS == 1 ) {