]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: devices: m25p80: Make sure the buffer passed in op is DMA-able
authorBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 17 Sep 2018 14:31:30 +0000 (16:31 +0200)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Tue, 18 Sep 2018 08:17:48 +0000 (10:17 +0200)
commit4ff57b42cccbfcbae3203895552603bf61fa28a8
tree88e32db1e0460c11dda408086e7f3d9c1399ef43
parent71182f98dcbb9c15997d7d4e8247e13a7701b291
mtd: devices: m25p80: Make sure the buffer passed in op is DMA-able

As documented in spi-mem.h, spi_mem_op->data.buf.{in,out} must be
DMA-able, and commit a4cd3148e063 ("mtd: spi-nor: Use the spi_mem_xx()
API") failed to follow this rule as buffers passed to
->{read,write}_reg() are usually placed on the stack.

Fix that by allocating a scratch buffer and copying the data around.

Fixes: a4cd3148e063 ("mtd: spi-nor: Use the spi_mem_xx() API")
Reported-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
drivers/mtd/devices/m25p80.c