Skip to content

Commit

Permalink
iio: adc: ad7768-1: Fix insufficient alignment of timestamp.
Browse files Browse the repository at this point in the history
[ Upstream commit ffbc26b ]

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: a1caeeb ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed May 22, 2025
1 parent b9e0997 commit 7b16d3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/adc/ad7768-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ struct ad7768_state {
union {
struct {
__be32 chan;
s64 timestamp;
aligned_s64 timestamp;
} scan;
__be32 d32;
u8 d8[2];
Expand Down

0 comments on commit 7b16d3c

Please sign in to comment.