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 :219653] Unchecked return value in drivers/modem/hl7800.c #33034

Closed
zephyrbot opened this issue Mar 7, 2021 · 0 comments · Fixed by #33223
Closed

[Coverity CID :219653] Unchecked return value in drivers/modem/hl7800.c #33034

zephyrbot opened this issue Mar 7, 2021 · 0 comments · Fixed by #33223
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/bd97359a5338b2542d19011b6d6aa1d8d1b9cc3f/drivers/modem/hl7800.c#L3350

Category: Error handling issues
Function: hl7800_rx
Component: Drivers
CID: 219653

Details:

k_sem_take(&ictx.mdm_ctx.rx_sem, K_FOREVER);

3344             /* FIRMWARE UPDATE RESPONSES */
3345             CMD_HANDLER("+WDSI: ", device_service_ind),
3346         };
3347    
3348         while (true) {
3349             /* wait for incoming data */
>>>     CID 219653:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "k_sem_take" without checking return value (as is done elsewhere 13 out of 15 times).
3350             k_sem_take(&ictx.mdm_ctx.rx_sem, K_FOREVER);
3351    
3352             hl7800_read_rx(&rx_buf);
3353             /* If an external module hasn't locked the command processor,
3354              * then do so now.
3355              */

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 Mar 7, 2021
nashif pushed a commit that referenced this issue Mar 11, 2021
Added (void) cast to supress coverity report. The usage of K_FOREVER
tells me we're not interested in the returned value.

Coverity-CID: 219653
Fixes #33034

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
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.

2 participants