Skip to content

Commit a49c35b

Browse files
authored
Fix incorrect error checking of prvCreateIdleTasks (#1158)
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.
1 parent 5f3bab1 commit a49c35b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3630,7 +3630,7 @@ static BaseType_t prvCreateIdleTasks( void )
36303630
#endif /* configSUPPORT_STATIC_ALLOCATION */
36313631

36323632
/* Break the loop if any of the idle task is failed to be created. */
3633-
if( xReturn == pdFAIL )
3633+
if( xReturn != pdPASS )
36343634
{
36353635
break;
36363636
}

0 commit comments

Comments
 (0)