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 :203524]Incorrect expression in /subsys/bluetooth/controller/ticker/ticker.c #18382

Closed
aasthagr opened this issue Aug 17, 2019 · 4 comments
Assignees
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: medium Medium impact/importance bug

Comments

@aasthagr
Copy link
Collaborator

Static code scan issues seen in File: /subsys/bluetooth/controller/ticker/ticker.c
Category: Incorrect expression
Function: ticker_enqueue
Component: Bluetooth
CID: 203524
Please fix or provide comments to square it off in coverity in the link: https://scan9.coverity.com/reports.htm#v32951/p12996

@aasthagr aasthagr added area: Bluetooth bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix labels Aug 17, 2019
@aasthagr
Copy link
Collaborator Author

*** CID 203524:  Incorrect expression  (UNUSED_VALUE)
/subsys/bluetooth/controller/ticker/ticker.c: 375 in ticker_enqueue()
369     
370     	node = &instance->nodes[0];
371     	ticker_new = &node[id];
372     	ticks_to_expire = ticker_new->ticks_to_expire;
373     
374     	current = instance->ticker_id_head;
>>>     CID 203524:  Incorrect expression  (UNUSED_VALUE)
>>>     Assigning value from "current" to "previous" here, but that stored value is overwritten before it can be used.
375     	previous = current;
376     
377     	/* Find insertion point for new ticker node and adjust ticks_to_expire
378     	 * relative to insertion point
379     	 */
380     	previous = TICKER_NULL;

@galak galak added the priority: medium Medium impact/importance bug label Aug 18, 2019
@aescolar aescolar assigned cvinayak and mtpr-ot and unassigned cvinayak Aug 18, 2019
@aescolar
Copy link
Member

@mtpr-ot introduced in 3a9173a

@mtpr-ot
Copy link
Collaborator

mtpr-ot commented Aug 19, 2019

This is a copy-paste mistake when doing the CONFIG_BT_TICKER_COMPATIBILITY_MODE conditions. It has no impact as the desired initialization is in line 380. Will make a PR with an update.

aescolar pushed a commit that referenced this issue Aug 19, 2019
Fixes coverity issue: [Coverity CID :203524] Incorrect expression in
/subsys/bluetooth/controller/ticker/ticker.c #18382

Signed-off-by: Morten Priess <mtpr@oticon.com>
@mtpr-ot
Copy link
Collaborator

mtpr-ot commented Aug 19, 2019

Solution merged

@mtpr-ot mtpr-ot closed this as completed Aug 19, 2019
LeiW000 pushed a commit to LeiW000/zephyr that referenced this issue Sep 2, 2019
Fixes coverity issue: [Coverity CID :203524] Incorrect expression in
/subsys/bluetooth/controller/ticker/ticker.c zephyrproject-rtos#18382

Signed-off-by: Morten Priess <mtpr@oticon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants