spi: fsl-espi: avoid processing uninitalized data on error
PATCH 1/1 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.
A functionally identical patch was submitted for stable already, however due to a merge conflict a separate patch is needed for next.
--- drivers/spi/spi-fsl-espi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-fsl-espi.c +1 -1
@@ -455,7 +455,7 @@ static void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) mspi->len -= rx_nr_bytes; -if (mspi->rx) { +if (rx_nr_bytes && mspi->rx) { *(u32 *)mspi->rx = rx_data; mspi->rx +=4 ; }
Signature · 6 lines
2.10.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 3 lines · Heiner Kallweit
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:
This doesn't apply against current code, please check and resend.
Am 27.10.2016 um 12:14 schrieb Mark Brown:
Quoted 7 lines · Heiner Kallweit
Quoted 3 lines
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:This doesn't apply against current code, please check and resend.
OK, I'll provide an updated one. I thought it was intended to replace Arnd's patch for next.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html