linux-stable/include/linux/iio/adc
Lars-Peter Clausen 067d9120a3 iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack
commit 0fb6ee8d0b upstream.

Use a heap allocated memory for the SPI transfer buffer. Using stack memory
can corrupt stack memory when using DMA on some systems.

This change moves the buffer from the stack of the trigger handler call to
the heap of the buffer of the state struct. The size increases takes into
account the alignment for the timestamp, which is 8 bytes.

The 'data' buffer is split into 'tx_buf' and 'rx_buf', to make a clearer
separation of which part of the buffer should be used for TX & RX.

Fixes: af3008485e ("iio:adc: Add common code for ADI Sigma Delta devices")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201124123807.19717-1-alexandru.ardelean@analog.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:54:19 +01:00
..
ad_sigma_delta.h iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack 2020-12-30 11:54:19 +01:00
adi-axi-adc.h iio: adc: adi-axi-adc: add support for AXI ADC IP core 2020-04-19 16:56:22 +01:00
stm32-dfsdm-adc.h iio: adc: stm32-dfsdm: include stm32-dfsdm-adc.h 2018-05-20 11:25:25 +01:00