X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=drivers%2Fspi%2Fspi.c;h=c2899161ccacf8a6ecaebd807ef2613349104cae;hb=24a0013a04e81e95198daab98edf4df02e191568;hp=a52f16685d6aa40b18c642322ce7e9af7c6c9f48;hpb=a2fd4f9fa3b9f051550b36c4dfa74bc32bda24ee;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index a52f16685d6a..c2899161ccac 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1351,6 +1351,11 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message) struct spi_master *master = spi->master; 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 * only one data pin like SPI_3WIRE (switches direction) or where * either MOSI or MISO is missing. They can also be caused by