diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-10-25 16:57:10 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-10-26 06:14:52 -0400 |
commit | 5c0ba57744b1422d528f19430dd66d6803cea86f (patch) | |
tree | c0d2696dc0d1d5f68a783e7f84f4dc8e23864633 | |
parent | 1001354ca34179f3db924eb66672442a173147dc (diff) |
spi: fsl-espi: avoid processing uninitalized data on error
When we get a spurious interrupt in fsl_espi_irq, we end up
processing four uninitalized bytes of data, as shown in this
warning message:
drivers/spi/spi-fsl-espi.c: In function 'fsl_espi_irq':
drivers/spi/spi-fsl-espi.c:462:4: warning: 'rx_data' may be used uninitialized in this function [-Wmaybe-uninitialized]
This adds another check so we skip the data in this case.
Fixes: 6319a68011b8 ("spi/fsl-espi: avoid infinite loops on fsl_espi_cpu_irq()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/spi/spi-fsl-espi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index 7451585a080e..2c175b9495f7 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c | |||
@@ -458,7 +458,7 @@ static void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) | |||
458 | 458 | ||
459 | mspi->len -= rx_nr_bytes; | 459 | mspi->len -= rx_nr_bytes; |
460 | 460 | ||
461 | if (mspi->rx) | 461 | if (rx_nr_bytes && mspi->rx) |
462 | mspi->get_rx(rx_data, mspi); | 462 | mspi->get_rx(rx_data, mspi); |
463 | } | 463 | } |
464 | 464 | ||