]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: adc: ad7768-1: Fix insufficient alignment of timestamp.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 13 Apr 2025 10:34:25 +0000 (11:34 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 18 Apr 2025 15:07:38 +0000 (16:07 +0100)
On architectures where an s64 is not 64-bit aligned, this may result
insufficient alignment of the timestamp and the structure being too small.
Use aligned_s64 to force the alignment.

Fixes: a1caeebab07e ("iio: adc: ad7768-1: Fix too small buffer passed to iio_push_to_buffers_with_timestamp()") # aligned_s64 newer
Reported-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250413103443.2420727-3-jic23@kernel.org
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7768-1.c

index 5a863005aca6d1082b91a52655eaaa83c6871151..5e0be36af0c5c26f9332a779c27c38479f3af167 100644 (file)
@@ -168,7 +168,7 @@ struct ad7768_state {
        union {
                struct {
                        __be32 chan;
-                       s64 timestamp;
+                       aligned_s64 timestamp;
                } scan;
                __be32 d32;
                u8 d8[2];