spi: Skip zero-length transfers in spi_transfer_one_message()
With the introduction of
26751de25d25 ("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: Phil Elwell <[email protected]>
Fixes: 26751de25d25 ("spi: bcm2835: Micro-optimise FIFO loops")
Signed-off-by: Nicolas Saenz Julienne <[email protected]>
[1] https://github.com/raspberrypi/linux/issues/4100
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>