Skip to content

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

@zephyrbot

Description

@zephyrbot

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.

Metadata

Metadata

Labels

CoverityA Coverity detected issue or its fixbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions