Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: ti-ads131e08: Use new iio_push_to_buffers_with_ts() to provide length sanity check.

By providing the size of the buffer used, runtime checks can be performed
to ensure not overrun.

Also change the pushed data pointer to be that of the structure that also
contains the timestamp. Not an actual bug but semantically incorrect to
push the channel data when we want the storage with the timestamp as well.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250413103443.2420727-9-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

+2 -2
+2 -2
drivers/iio/adc/ti-ads131e08.c
··· 664 664 i++; 665 665 } 666 666 667 - iio_push_to_buffers_with_timestamp(indio_dev, st->tmp_buf.data, 668 - iio_get_time_ns(indio_dev)); 667 + iio_push_to_buffers_with_ts(indio_dev, &st->tmp_buf, sizeof(st->tmp_buf), 668 + iio_get_time_ns(indio_dev)); 669 669 670 670 out: 671 671 iio_trigger_notify_done(indio_dev->trig);