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 :219529] Unchecked return value in subsys/bluetooth/controller/ll_sw/ull_filter.c #32917

Closed
zephyrbot opened this issue Mar 5, 2021 · 3 comments · Fixed by #35426
Assignees
Labels
area: Bluetooth Controller area: Bluetooth 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
Milestone

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/bd97359a5338b2542d19011b6d6aa1d8d1b9cc3f/subsys/bluetooth/controller/ll_sw/ull_filter.c#L1121

Category: Error handling issues
Function: target_resolve
Component: Bluetooth
CID: 219529

Details:

mayfly_enqueue(TICKER_USER_ID_THREAD,

1115          * Pass param FILTER_IDX_NONE if RPA can not be resolved,
1116          * or index in cache if it can be resolved
1117          */
1118         if (twork->cb) {
1119             mfy.fp = twork->cb;
1120             mfy.param = (void *) ((unsigned int) j);
>>>     CID 219529:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "mayfly_enqueue" without checking return value (as is done elsewhere 15 out of 17 times).
1121             mayfly_enqueue(TICKER_USER_ID_THREAD,
1122                        TICKER_USER_ID_LLL, 1, &mfy);
1123         }
1124     }
1125    
1126     static uint8_t prpa_cache_try_resolve(bt_addr_t *rpa)

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 5, 2021
@gudnimg
Copy link
Contributor

gudnimg commented Mar 7, 2021

I couldn’t find any documentation for the mayfly code. https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/controller/util/mayfly.c there are no doxygen comments in mayfly.h

Seems to return 0 or 1 but it is unclear to me what those values mean.

I’m curious what a “mayfly” is 🤔

@cvinayak
Copy link
Contributor

cvinayak commented Mar 8, 2021

mayfly is an internal framework in the Bluetooth Low Energy Controller implementation to schedule a function's execution in a different execution context. It can be seen as a software interrupt mechanism.

@github-actions
Copy link

github-actions bot commented May 8, 2021

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label May 8, 2021
@galak galak added this to the v2.6.0 milestone May 11, 2021
@cvinayak cvinayak removed the Stale label May 12, 2021
cvinayak added a commit to cvinayak/zephyr that referenced this issue May 19, 2021
Explicitly ignore return value from call to mayfly_enqueue.

Fixes zephyrproject-rtos#32917, zephyrproject-rtos#32961.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
nashif pushed a commit that referenced this issue May 19, 2021
Explicitly ignore return value from call to mayfly_enqueue.

Fixes #32917, #32961.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Controller area: Bluetooth 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.

7 participants