Skip to content

Commit 8bd1851

Browse files
jic23gregkh
authored andcommitted
iio: temp: maxim-thermocouple: Fix potential lack of DMA safe buffer.
[ Upstream commit f79aeb6 ] The trick of using __aligned(IIO_DMA_MINALIGN) ensures that there is no overlap between buffers used for DMA and those used for driver state storage that are before the marking. It doesn't ensure anything above state variables found after the marking. Hence move this particular bit of state earlier in the structure. Fixes: 10897f3 ("iio: temp: maxim_thermocouple: Fix alignment for DMA safety") Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250413103443.2420727-14-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1ed6269 commit 8bd1851

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/temperature/maxim_thermocouple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ static const struct maxim_thermocouple_chip maxim_thermocouple_chips[] = {
121121
struct maxim_thermocouple_data {
122122
struct spi_device *spi;
123123
const struct maxim_thermocouple_chip *chip;
124+
char tc_type;
124125

125126
u8 buffer[16] __aligned(IIO_DMA_MINALIGN);
126-
char tc_type;
127127
};
128128

129129
static int maxim_thermocouple_read(struct maxim_thermocouple_data *data,

0 commit comments

Comments
 (0)