summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorMartin Sperl <kernel@martin.sperl.org>2019-03-30 09:30:59 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-10 10:33:41 +0100
commitfe49c3de737219ceb53480b602ad7a2cce129147 (patch)
tree660f181f57dfca72b9e0f65a7e915333b01486c7 /drivers/spi
parenta4a9ee79036bda2ad5f8b9aa0664c45e6a9db7f8 (diff)
downloadlinux-stable-fe49c3de737219ceb53480b602ad7a2cce129147.tar.gz
linux-stable-fe49c3de737219ceb53480b602ad7a2cce129147.tar.bz2
linux-stable-fe49c3de737219ceb53480b602ad7a2cce129147.zip
spi: bcm2835aux: remove dangerous uncontrolled read of fifo
[ Upstream commit c7de8500fd8ecbb544846dd5f11dca578c3777e1 ] This read of the fifo is a potential candidate for a race condition as the spi transfer is not necessarily finished and so can lead to an early read of the fifo that still misses data. So it has been removed. Fixes: 1ea29b39f4c812ec ("spi: bcm2835aux: add bcm2835 auxiliary spi device...") Suggested-by: Hubert Denkmair <h.denkmair@intence.de> Signed-off-by: Martin Sperl <kernel@martin.sperl.org> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-bcm2835aux.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c
index 79306e654f73..b4217f948001 100644
--- a/drivers/spi/spi-bcm2835aux.c
+++ b/drivers/spi/spi-bcm2835aux.c
@@ -194,13 +194,6 @@ static void bcm2835aux_spi_transfer_helper(struct bcm2835aux_spi *bs)
BCM2835_AUX_SPI_STAT_TX_FULL))) {
bcm2835aux_wr_fifo(bs);
}
-
- /* and check if we have reached "done" */
- while (bs->rx_len &&
- (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
- BCM2835_AUX_SPI_STAT_BUSY))) {
- bcm2835aux_rd_fifo(bs);
- }
}
static irqreturn_t bcm2835aux_spi_interrupt(int irq, void *dev_id)