Skip to content

[Coverity CID: 529876] Unchecked return value in drivers/audio/max98091.c #92594

@zephyrbot

Description

@zephyrbot

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/4bd1d39c67dfb4860fbd4f9ccc17e084aa32d763/drivers/audio/max98091.c#L1

Category: Error handling issues
Function: max98091_read_reg
Component: Drivers
CID: 529876

Details:

i2c_reg_read_byte_dt(&dev_cfg->i2c, reg, val);

29     }
30     
31     static void max98091_read_reg(const struct device *dev, uint8_t reg, uint8_t *val)
32     {
33     	const struct max98091_config *const dev_cfg = dev->config;
34     
>>>     CID 529876:         Error handling issues  (CHECKED_RETURN)
>>>     Calling "i2c_reg_read_byte_dt" without checking return value (as is done elsewhere 265 out of 285 times).
35     	i2c_reg_read_byte_dt(&dev_cfg->i2c, reg, val);
36     }
37     
38     static void max98091_update_reg(const struct device *dev, uint8_t reg, uint8_t mask, uint8_t val)
39     {
40     	const struct max98091_config *const dev_cfg = dev->config;

For more information about the violation, check the Coverity Reference. (CWE-252)

Please fix or provide comments in coverity using the link:

https://scan9.scan.coverity.com/#/project-view/29271/12996?selectedIssue=529876

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 MAINTAINERS file.

Also see the related Coverity documentation for more information.

Metadata

Metadata

Assignees

Labels

CoverityA Coverity detected issue or its fixarea: AudiobugThe issue is a bug, or the PR is fixing a bugplatform: ADIAnalog Devices, Inc.priority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions