Commit 24a0013a authored by Mark Brown's avatar Mark Brown

spi: More sanity checks for transfers

Check that transfers are non-empty and that there is a completion for
them.
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent a2fd4f9f
...@@ -1351,6 +1351,11 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message) ...@@ -1351,6 +1351,11 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
struct spi_master *master = spi->master; struct spi_master *master = spi->master;
struct spi_transfer *xfer; struct spi_transfer *xfer;
if (list_empty(&message->transfers))
return -EINVAL;
if (!message->complete)
return -EINVAL;
/* Half-duplex links include original MicroWire, and ones with /* Half-duplex links include original MicroWire, and ones with
* only one data pin like SPI_3WIRE (switches direction) or where * only one data pin like SPI_3WIRE (switches direction) or where
* either MOSI or MISO is missing. They can also be caused by * either MOSI or MISO is missing. They can also be caused by
......
Markdown is supported
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