diff options
author | Oleksij Rempel <[email protected]> | 2022-01-07 09:14:01 +0100 |
---|---|---|
committer | Jonathan Cameron <[email protected]> | 2022-01-23 18:23:48 +0000 |
commit | b7a78a8adaa8849c02f174d707aead0f85dca0da (patch) | |
tree | 2e4a56436e4155f532f212f978d89f79599ab6e0 /lib/test-string_helpers.c | |
parent | e783362eb54cd99b2cac8b3a9aeac942e6f6ac07 (diff) |
iio: adc: tsc2046: fix memory corruption by preventing array overflow
On one side we have indio_dev->num_channels includes all physical channels +
timestamp channel. On other side we have an array allocated only for
physical channels. So, fix memory corruption by ARRAY_SIZE() instead of
num_channels variable.
Note the first case is a cleanup rather than a fix as the software
timestamp channel bit in active_scanmask is never set by the IIO core.
Fixes: 9374e8f5a38d ("iio: adc: add ADC driver for the TI TSC2046 controller")
Signed-off-by: Oleksij Rempel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions