]> Git Repo - linux.git/commit
spi: Skip zero-length transfers in spi_transfer_one_message()
authorNicolas Saenz Julienne <[email protected]>
Thu, 11 Feb 2021 18:08:20 +0000 (19:08 +0100)
committerMark Brown <[email protected]>
Fri, 12 Feb 2021 12:41:59 +0000 (12:41 +0000)
commitb306320322c9cfaa465bc2c7367acf6072b1ac0e
treed4b96f171e062dfe9e3a5ef8d1902b3fe3c316bb
parent386f771aad15dd535f2368b4adc9958c0160edd4
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]>
drivers/spi/spi.c
This page took 0.059873 seconds and 4 git commands to generate.