diff options
| author | Guilherme Ivo Bozi <guilherme.bozi@usp.br> | 2026-05-12 21:31:50 -0300 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-05-31 10:59:41 +0100 |
| commit | 947eb6f0a274f8b15a0248051a65b069effd5057 (patch) | |
| tree | 6e9782866f2e8bc2a2d8594319449b90b9d16a2c /tools/perf/scripts/python | |
| parent | 8402b3266173e3c282244246354b9863bca92ffd (diff) | |
iio: adc: xilinx-ams: fix out-of-bounds channel lookup in event handling
ams_event_to_channel() may return a pointer past the end of
dev->channels when no matching scan_index is found. This can lead
to invalid memory access in ams_handle_event().
Add a bounds check in ams_event_to_channel() and return NULL when
no channel is found. Also guard the caller to safely handle this
case.
Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver")
Signed-off-by: Guilherme Ivo Bozi <guilherme.bozi@usp.br>
Reviewed-by: Salih Erim <salih.erim@amd.com>
Tested-by: Salih Erim <salih.erim@amd.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
