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: 220313] Logically dead code in subsys/bluetooth/services/ots/ots_obj_manager.c #33831

Closed
zephyrbot opened this issue Mar 29, 2021 · 0 comments · Fixed by #33861
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/subsys/bluetooth/services/ots/ots_obj_manager.c#L170

Category: Control flow issues
Function: bt_gatt_ots_obj_manager_obj_get
Component: Bluetooth
CID: 220313

Details:

index = obj_id_to_index(id);

164         if (id < OTS_OBJ_ID_START_RANGE ||
165             (IS_ENABLED(CONFIG_BT_OTS_DIR_LIST_OBJ) &&
166             id != OTS_OBJ_ID_DIR_LIST)) {
167             return -EINVAL;
168         }
169    
>>>     CID 220313:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "index = obj_id_to_index(id);".
170         index = obj_id_to_index(id);
171    
172         if (index >= ARRAY_SIZE(obj_manager->pool)) {
173             return -EINVAL;
174         }
175    

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
@Thalley Thalley self-assigned this Mar 30, 2021
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.

5 participants