Skip to content

Commit

Permalink
fix(freertos-smp): Prevent run state change check before TCB is created
Browse files Browse the repository at this point in the history
This commit prevents the run state change check to happen before a TCB
has been created.
  • Loading branch information
sudeep-mohanty committed Aug 12, 2024
1 parent e09c7eb commit b82097a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down

0 comments on commit b82097a

Please sign in to comment.