Skip to content

Commit

Permalink
Fix incorrect error checking of prvCreateIdleTasks (FreeRTOS#1158)
Browse files Browse the repository at this point in the history
In environments that do not support static allocation
(configSUPPORT_STATIC_ALLOCATION == 0), at prvCreateIdleTasks(), call
xCreateTask() and compare its return value to pdFAIL to check whether
xCreateTask() failed. However, xCreateTask() returns
errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY as the error value, so the
result of this comparison is always false.

This commit fixes this problem by changing the return value comparison
to pdPASS instead of pdFAIL.
  • Loading branch information
kakkoko authored Oct 16, 2024
1 parent 5f3bab1 commit a49c35b
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 @@ -3630,7 +3630,7 @@ static BaseType_t prvCreateIdleTasks( void )
#endif /* configSUPPORT_STATIC_ALLOCATION */

/* Break the loop if any of the idle task is failed to be created. */
if( xReturn == pdFAIL )
if( xReturn != pdPASS )
{
break;
}
Expand Down

0 comments on commit a49c35b

Please sign in to comment.