Skip to content

drivers: adc_ad4130|adc_7124: Add ret initialization in *_perform_read() #90592

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

Merged

Conversation

anangl
Copy link
Member

@anangl anangl commented May 26, 2025

Add initialization of ret to avoid reports of uninitialized variable being returned. This variable normally gets initialized while the loop iterates over channels, but potentially it could be left uninitialized if the loop finished in its first iteration because of no channels to be processed.

Fixes #90511.
Fixes #90560.

Add initialization of `ret` to avoid reports of uninitialized variable
being returned. This variable normally gets initialized while the loop
iterates over channels, but potentially it could be left uninitialized
if the loop finished in its first iteration because of no channels to
be processed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
@github-actions github-actions bot added platform: ADI Analog Devices, Inc. area: ADC Analog-to-Digital Converter (ADC) labels May 26, 2025
Copy link

Copy link
Member

@MaureenHelm MaureenHelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @anangl !

@kartben kartben merged commit a9405d0 into zephyrproject-rtos:main May 28, 2025
27 checks passed
@anangl anangl deleted the uninitialized_ret_ad4130_ad7124 branch May 28, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) platform: ADI Analog Devices, Inc.
Projects
None yet
6 participants