]> git.baikalelectronics.ru Git - kernel.git/commit
iio: accel: mxc4005: Fix overread of data and alignment issue.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 1 May 2021 17:01:07 +0000 (18:01 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 May 2021 12:54:28 +0000 (13:54 +0100)
commita5c732f7bcd7e671533247962c14db16dce4ad1a
tree9d70d07e3e71119351cf5f466eda3d17d44b07a9
parent9b6fcde1610b69f11111e704fc503200d205ad99
iio: accel: mxc4005: Fix overread of data and alignment issue.

The bulk read size is based on the size of an array that also has
space for the timestamp alongside the channels.
Fix that and also fix alignment of the buffer passed
to iio_push_to_buffers_with_timestamp.

Found during an audit of all calls to this function.

Fixes: 18050b4b28ad ("iio: mxc4005: add triggered buffer mode for mxc4005")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210501170121.512209-6-jic23@kernel.org
drivers/iio/accel/mxc4005.c