]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio:chemical:sps30: Fix timestamp alignment
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 17 May 2020 17:29:59 +0000 (18:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jun 2020 18:22:50 +0000 (20:22 +0200)
commit7081ef3b1840569e7c20c94581de12d456808145
treee524ed28149b87c7bb5d5355f3d92b6fa72b05d8
parent9978af35e163809f30f3b5c5dcdd7989a524c91e
iio:chemical:sps30: Fix timestamp alignment

commit a5bf6fdd19c327bcfd9073a8740fa19ca4525fd4 upstream.

One of a class of bugs pointed out by Lars in a recent review.
iio_push_to_buffers_with_timestamp assumes the buffer used is aligned
to the size of the timestamp (8 bytes).  This is not guaranteed in
this driver which uses an array of smaller elements on the stack.

Fixes: 232e0f6ddeae ("iio: chemical: add support for Sensirion SPS30 sensor")
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: <Stable@vger.kernel.org>
Acked-by: Tomasz Duszynski <tomasz.duszynski@octakon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/chemical/sps30.c