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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:35 +0000 (16:56 +0200)
commit638ba5aa15ac979ea549ddc7d6780fb9746c7f07
tree96e8f01861411a4fe28cd544321e4b86f8bb4537
parent0d220d40b3f3a43931d7ed9b961b37c70774f264
iio: accel: mxc4005: Fix overread of data and alignment issue.

[ Upstream commit f65802284a3a337510d7f8f916c97d66c74f2e71 ]

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: 1ce0eda0f757 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/accel/mxc4005.c