diff options
author | Andrew Gabbasov <andrew_gabbasov@mentor.com> | 2015-06-30 10:48:37 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-07-07 13:09:46 +0100 |
commit | 65598c13fd66c3b5eac16d5b8eacc704aa17ce40 (patch) | |
tree | efe1bffa55ae29af9ec71def84e35727e93b2bd9 /arch/mips/ath79/setup.c | |
parent | d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754 (diff) | |
download | linux-65598c13fd66c3b5eac16d5b8eacc704aa17ce40.tar.gz linux-65598c13fd66c3b5eac16d5b8eacc704aa17ce40.tar.bz2 linux-65598c13fd66c3b5eac16d5b8eacc704aa17ce40.zip |
spi: Fix per-page mapping of unaligned vmalloc-ed buffer
spi_map_buf() processes mapping of vmalloc-ed buffers in a special way,
making mapping of every page separately. However, if the buffer is not
aligned to page boundary (e.g. sub-array in a vmalloc-ed array), it
fills the scatter table with page-size unaligned pieces, that cross
page boundaries. This is incorrect and can, for example, cause memory
corruption and various crashes when working with ubifs on spi-nor chips
(though those drivers are themselves buggy in that they should be
providing DMAable memory to the SPI framework).
Fix this by using proper scatter table size and intra-page buffer lengths,
so that the whole buffer splits into separate scatter table entries on
page boundaries.
Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'arch/mips/ath79/setup.c')
0 files changed, 0 insertions, 0 deletions