Skip to content

[Coverity CID :189511]Code maintainability issues in /subsys/settings/src/settings_fcb.c #11095

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

Closed
mandarcthorat1 opened this issue Nov 5, 2018 · 3 comments
Assignees
Labels
area: Other 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

@mandarcthorat1
Copy link
Contributor

Static code scan issues seen in File: /subsys/settings/src/settings_fcb.c
Category: Code maintainability issues
Function: settings_fcb_compress
Component: Other
CID: 189511
Please fix or provide comments to square it off in coverity in the link: https://scan9.coverity.com/reports.htm#v32951/p12996

@mandarcthorat1 mandarcthorat1 added area: Other bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix labels Nov 5, 2018
@galak galak added the priority: medium Medium impact/importance bug label Nov 21, 2018
@himanshujha199640
Copy link
Collaborator

The code in context is:

211                 rc = fcb_append_finish(&cf->cf_fcb, &loc2.loc);
212                 __ASSERT(rc == 0, "Failed to finish fcb_append.\n");
213         }
214         rc = fcb_rotate(&cf->cf_fcb);
215 
216         __ASSERT(rc == 0, "Failed to fcb rotate.\n");

And coverity says:

CID 189511 (#1 of 1): Unused value (UNUSED_VALUE)
returned_value: Assigning value from fcb_append_finish(&cf->cf_fcb, &loc2.loc) to rc here, but that stored value is overwritten before it can be used.

which means coverity doesn't understand the purpose of __ASSERT and the returrn value is actually used there. So, clearly it is another class of false postives I have observed while skimming through
other coverity issues.

So, please mark it as False positive in the Coverity triage, admins!
I don't have the rights to do it myself and closing this issue wouldn't be a nice
solution because next time again coverity will spit out the same issue.

@nvlsianpu
Copy link
Collaborator

because of #9521 this issue will be not valid anymore.

@himanshujha199640
Copy link
Collaborator

because of #9521 this issue will be not valid anymore.

OK. Then we would close this issue once the PR gets merged.
But best to mark it as False positive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Other 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

4 participants