linux_dsm_epyc7002/drivers/mtd/spi-nor
Geert Uytterhoeven 05521bd3d1 mtd: spi-nor: stm32-quadspi: Fix uninitialized error return code
With gcc 4.1.2:

    drivers/mtd/spi-nor/stm32-quadspi.c: In function ‘stm32_qspi_tx_poll’:
    drivers/mtd/spi-nor/stm32-quadspi.c:230: warning: ‘ret’ may be used uninitialized in this function

Indeed, if stm32_qspi_cmd.len is zero, ret will be uninitialized.
This length is passed from outside the driver using the
spi_nor.{read,write}{,_reg}() callbacks.

Several functions in drivers/mtd/spi-nor/spi-nor.c (e.g. write_enable(),
write_disable(), and erase_chip()) call spi_nor.write_reg() with a zero
length.

Fix this by returning an explicit zero on success.

Fixes: 0d43d7ab27 ("mtd: spi-nor: add driver for STM32 quad spi flash controller")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Ludovic Barre <ludovic.barre@st.com>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
2017-10-29 18:30:13 +01:00
..
aspeed-smc.c mtd: spi-nor: aspeed: set 4B setting for all chips 2017-08-14 17:23:50 +02:00
atmel-quadspi.c mtd: atmel-quadspi: Remove unneeded pinctrl header 2017-08-01 21:23:21 +02:00
cadence-quadspi.c mtd: spi-nor: cadence-quadspi: Add runtime PM support 2017-10-17 20:42:10 +02:00
fsl-quadspi.c mtd: spi-nor: introduce SPI 1-2-2 and SPI 1-4-4 protocols 2017-05-15 21:56:17 +02:00
hisi-sfc.c mtd: Convert to using %pOF instead of full_name 2017-08-15 14:00:43 +02:00
intel-spi-pci.c mtd: spi-nor: intel-spi: Add support for Intel Cedar Fork SPI serial flash 2017-10-10 18:56:40 +02:00
intel-spi-platform.c spi-nor: Add support for Intel SPI serial flash controller 2017-01-03 17:33:36 +00:00
intel-spi.c spi-nor: intel-spi: Fall back to use SW sequencer to erase 2017-10-11 09:57:50 +02:00
intel-spi.h spi-nor: Add support for Intel SPI serial flash controller 2017-01-03 17:33:36 +00:00
Kconfig spi-nor: intel-spi: Remove EXPERT dependency 2017-10-25 00:17:34 +02:00
Makefile mtd: spi-nor: fix "No newline at end of file" 2017-08-14 18:09:22 +02:00
mtk-quadspi.c mtd: mtk-nor: add suspend/resume support 2017-10-24 23:58:55 +02:00
nxp-spifi.c mtd: spi-nor: introduce SPI 1-2-2 and SPI 1-4-4 protocols 2017-05-15 21:56:17 +02:00
spi-nor.c mtd: spi-nor: Add support for Winbond w25q16dw 2017-10-23 09:49:51 +02:00
stm32-quadspi.c mtd: spi-nor: stm32-quadspi: Fix uninitialized error return code 2017-10-29 18:30:13 +01:00