diff mbox series

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

Message ID 20220517084139.6986-2-masahisa.kojima@linaro.org
State New
Headers show
Series spi-synquacer fixes and improvement | expand

Commit Message

Masahisa Kojima May 17, 2022, 8:41 a.m. UTC
"busy" variable is ORed without being initialized,
must be zeroed before use.

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

Comments

Jassi Brar May 18, 2022, 3:42 a.m. UTC | #1
On Tue, 17 May 2022 at 03:41, Masahisa Kojima
<masahisa.kojima@linaro.org> wrote:
>
> "busy" variable is ORed without being initialized,
> must be zeroed before use.
>
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> Signed-off-by: Satoru Okamoto <okamoto.satoru@socionext.com>
> ---
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
Tom Rini June 10, 2022, 9:40 p.m. UTC | #2
On Tue, May 17, 2022 at 05:41:36PM +0900, Masahisa Kojima wrote:

> "busy" variable is ORed without being initialized,
> must be zeroed before use.
> 
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> Signed-off-by: Satoru Okamoto <okamoto.satoru@socionext.com>
> Acked-by: Jassi Brar <jaswinder.singh@linaro.org>

Applied to u-boot/next, thanks!
diff mbox series

Patch

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);