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: 236130] Wrong sizeof argument in drivers/adc/adc_lmp90xxx.c #35603

Closed
zephyrbot opened this issue May 25, 2021 · 0 comments · Fixed by #35638
Closed

[Coverity CID: 236130] Wrong sizeof argument in drivers/adc/adc_lmp90xxx.c #35603

zephyrbot opened this issue May 25, 2021 · 0 comments · Fixed by #35638
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/374629af906a24add294b1c3b945128cb6a486e8/drivers/adc/adc_lmp90xxx.c#L250

Category: Incorrect expression
Function: lmp90xxx_read_reg8
Component: Drivers
CID: 236130

Details:

return lmp90xxx_read_reg(dev, addr, val, sizeof(val));

244         return err;
245     }
246    
247     static int lmp90xxx_read_reg8(const struct device *dev, uint8_t addr,
248                       uint8_t *val)
249     {
>>>     CID 236130:  Incorrect expression  (SIZEOF_MISMATCH)
>>>     Passing argument "val" of type "uint8_t *" and argument "4U /* sizeof (val) */" to function "lmp90xxx_read_reg" is suspicious.
250         return lmp90xxx_read_reg(dev, addr, val, sizeof(val));
251     }
252    
253     static int lmp90xxx_write_reg(const struct device *dev, uint8_t addr,
254                       uint8_t *dptr,
255                       size_t len)

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 May 25, 2021
@galak galak added the has-pr label May 25, 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.

3 participants