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: 220317] Unchecked return value in tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c #33827

Closed
zephyrbot opened this issue Mar 29, 2021 · 1 comment · Fixed by #33859
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:/zephyrproject-rtos/zephyr/tree/169144afa1826511ee6ec3f53d590b2c0d39d3d4/tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c#L145

Category: Error handling issues
Function: tpipe_put_small_size
Component: Tests
CID: 220317

Details:

k_pipe_put(ppipe, &data[i], to_wt, &wt_byte, 1, timeout);

139     {
140         size_t to_wt, wt_byte = 0;
141    
142         for (int i = 0; i < PIPE_LEN; i += wt_byte) {
143             /**TESTPOINT: pipe put*/
144             to_wt = 15;
>>>     CID 220317:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "k_pipe_put" without checking return value (as is done elsewhere 6 out of 7 times).
145             k_pipe_put(ppipe, &data[i], to_wt, &wt_byte, 1, timeout);
146         }
147     }
148    
149     static void tpipe_get_small_size(struct k_pipe *ppipe, k_timeout_t timeout)
150     {

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v29271/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 Mar 29, 2021
@nashif nashif assigned LeiW000 and unassigned nashif, andyross and dcpleung Mar 30, 2021
@nashif
Copy link
Member

nashif commented Mar 30, 2021

@LeiW000 please assign

@LeiW000 LeiW000 assigned Zhaoningx and unassigned LeiW000 Mar 30, 2021
Zhaoningx added a commit to Zhaoningx/zephyr that referenced this issue Mar 31, 2021
Add a ASSERT to check tpipe_put_small_size return
value.

Fixes zephyrproject-rtos#33827

Signed-off-by: Ningx Zhao <[email protected]>
carlescufi pushed a commit that referenced this issue Apr 6, 2021
Add a ASSERT to check tpipe_put_small_size return
value.

Fixes #33827

Signed-off-by: Ningx Zhao <[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