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

[Coverity CID :216795] Unchecked return value in tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c #31680

Closed
zephyrbot opened this issue Jan 26, 2021 · 0 comments · Fixed by #31788
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/f91e9fba51e5da46ee5c6822f8656713d74a6ecf/tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c#L408

Category: Error handling issues
Function: test_msgq_empty
Component: Tests
CID: 216795

Details:

402         /* since there is a thread is waiting for message, this queue
403          * can't be cleanup
404          */
405         ret = k_msgq_cleanup(&msgq1);
406         zassert_equal(ret, -EBUSY, NULL);
407         /* put a message to wake that getting thread */
>>>     CID 216795:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "k_msgq_put" without checking return value (as is done elsewhere 16 out of 18 times).
408         k_msgq_put(&msgq1, &data[0], K_NO_WAIT);
409         k_thread_abort(tid);
410     }
411    
412     /**
413      * @brief Put message to a full queue

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/p12996.

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels Jan 26, 2021
@nashif nashif assigned LeiW000 and enjiamai and unassigned nashif, andrewboie and andyross Jan 26, 2021
enjiamai pushed a commit to enjiamai/zephyr that referenced this issue Jan 29, 2021
Add a return value check of message queue test cases, to fix
issue zephyrproject-rtos#31680, which is for CID :216795.

Signed-off-by: Enjia Mai <[email protected]>
nashif pushed a commit that referenced this issue Feb 2, 2021
Add a return value check of message queue test cases, to fix
issue #31680, which is for CID :216795.

Signed-off-by: Enjia Mai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants