Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect error checking of prvCreateIdleTasks #1158

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

kakkoko
Copy link
Contributor

@kakkoko kakkoko commented Oct 16, 2024

Fix incorrect error checking of prvCreateIdleTasks

Description

In environments that do not support static allocation (configSUPPORT_STATIC_ALLOCATION == 0), at prvCreateIdleTasks(), it calls xCreateTask() and compares its return value to pdFAIL (0) to check whether xCreateTask() failed. However, xCreateTask() returns errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY (-1) as the error value, so the result of this comparison is always false.

This MR fixes this problem by changing the return value comparison to != pdPASS instead of == pdFAIL.

Test Steps

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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.
Copy link

sonarcloud bot commented Oct 16, 2024

@aggarg aggarg merged commit a49c35b into FreeRTOS:main Oct 16, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants