summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2025-04-13 11:34:24 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-22 14:29:36 +0200
commitb37c112ef2655b38216969fa21fdaf288a69064c (patch)
treeca66d3cd759af6969397f23cbf43f5bb27f79a67
parenta065f78eba2aa50a8893d449eaf5f0859bd36550 (diff)
iio: adc: ad7266: Fix potential timestamp alignment issue.
[ Upstream commit 52d349884738c346961e153f195f4c7fe186fcf4 ] On architectures where an s64 is only 32-bit aligned insufficient padding would be left between the earlier elements and the timestamp. Use aligned_s64 to enforce the correct placement and ensure the storage is large enough. Fixes: 54e018da3141 ("iio:ad7266: Mark transfer buffer as __be16") # aligned_s64 is much 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-2-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>
-rw-r--r--drivers/iio/adc/ad7266.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c
index 7949b076fb87..d4c9b85135f5 100644
--- a/drivers/iio/adc/ad7266.c
+++ b/drivers/iio/adc/ad7266.c
@@ -45,7 +45,7 @@ struct ad7266_state {
*/
struct {
__be16 sample[2];
- s64 timestamp;
+ aligned_s64 timestamp;
} data __aligned(IIO_DMA_MINALIGN);
};