drivers: adc_ad4130: Fix out-of-bounds accesses to channel_setup_cfg
Correct the size of the channel_setup_cfg array, as it should contain
entries for all available channels (AD4130_MAX_CHANNELS), not for the
available configuration slots (AD4130_MAX_SETUPS).
Move also checking of the channel index to the very beginning of
adc_ad4130_channel_setup(), to avoid potential writes to .live_cfg
beyond the channel_setup_cfg array.
Signed-off-by:
Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Loading
Please sign in to comment