]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spi-mem: check if data buffers are on stack
authorPratyush Yadav <p.yadav@ti.com>
Wed, 20 Apr 2022 10:20:22 +0000 (15:50 +0530)
committerMark Brown <broonie@kernel.org>
Thu, 21 Apr 2022 13:17:56 +0000 (14:17 +0100)
commit8f4ad9ede72d2875742a9dc863e48da10a2f8a9b
tree62f44dd0a9e96f8a87dc34171fa0d5097cea3aa5
parent2d84a1d2801fc3380ec4b480fa1ded044e6390dd
spi: spi-mem: check if data buffers are on stack

The buffers passed in the data phase must be DMA-able. Programmers often
don't realise this requirement and pass in buffers that reside on the
stack. This can be hard to spot when reviewing code. Reject ops if their
data buffer is on the stack to avoid this.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Link: https://lore.kernel.org/r/20220420102022.3310970-1-p.yadav@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mem.c