Skip to content
Unverified Commit b3063203 authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Mark Brown
Browse files

spi: Skip zero-length transfers in spi_transfer_one_message()

With the introduction of 26751de2

 ("spi: bcm2835: Micro-optimise
FIFO loops") it has become apparent that some users might initiate
zero-length SPI transfers. A fact the micro-optimization omitted, and
which turned out to cause crashes[1].

Instead of changing the micro-optimization itself, use a bigger hammer
and skip zero-length transfers altogether for drivers using the default
transfer_one_message() implementation.

Reported-by: default avatarPhil Elwell <phil@raspberrypi.com>
Fixes: 26751de2

 ("spi: bcm2835: Micro-optimise FIFO loops")
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>

[1] https://github.com/raspberrypi/linux/issues/4100
Link: https://lore.kernel.org/r/20210211180820.25757-1-nsaenzjulienne@suse.de

Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 386f771a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment