Skip to content

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

@zephyrbot

Description

@zephyrbot

Static code scan issues found in file:

https://github.com/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.

Metadata

Metadata

Assignees

Labels

CoverityA Coverity detected issue or its fixbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions