From a49c35b5dc0f1f521eef3ef993d401af7f26f439 Mon Sep 17 00:00:00 2001 From: kakkoko Date: Wed, 16 Oct 2024 18:36:20 +0900 Subject: [PATCH] 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. --- tasks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.c b/tasks.c index 1be3fca914c..6d86326c539 100644 --- a/tasks.c +++ b/tasks.c @@ -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; }