[PATCH 1/4] spi: synquacer: busy variable must be initialized before use

Masahisa Kojima masahisa.kojima at linaro.org
Tue May 17 10:41:36 CEST 2022


"busy" variable is ORed without being initialized,
must be zeroed before use.

Signed-off-by: Masahisa Kojima <masahisa.kojima at linaro.org>
Signed-off-by: Satoru Okamoto <okamoto.satoru at socionext.com>
---
 drivers/spi/spi-synquacer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-synquacer.c b/drivers/spi/spi-synquacer.c
index ce558c4bc0..62f85f0335 100644
--- a/drivers/spi/spi-synquacer.c
+++ b/drivers/spi/spi-synquacer.c
@@ -275,7 +275,7 @@ static int synquacer_spi_xfer(struct udevice *dev, unsigned int bitlen,
 {
 	struct udevice *bus = dev->parent;
 	struct synquacer_spi_priv *priv = dev_get_priv(bus);
-	u32 val, words, busy;
+	u32 val, words, busy = 0;
 
 	val = readl(priv->base + FIFOCFG);
 	val |= (1 << RX_FLUSH);
-- 
2.17.1



More information about the U-Boot mailing list