When called with a zero bcnt, r1 is used uninitialized.
Initialize it to an error in that case.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 drivers/mci/mci_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mci/mci_spi.c b/drivers/mci/mci_spi.c
index 41d8c25e2736..657ce9e42ee0 100644
--- a/drivers/mci/mci_spi.c
+++ b/drivers/mci/mci_spi.c
@@ -137,7 +137,7 @@ static uint mmc_spi_readdata(struct mmc_spi_host *host, 
void *xbuf,
                                uint32_t bcnt, uint32_t bsize)
 {
        uint8_t *buf = xbuf;
-       uint8_t r1;
+       uint8_t r1 = R1_SPI_ERROR;
        uint16_t crc;
        int i;
 
-- 
2.39.5


Reply via email to