From b1a2c51a0820fce803431e6ee5bd078bb1a65b0d Mon Sep 17 00:00:00 2001 From: Anand Saminathan Date: Sat, 16 Sep 2023 10:31:56 +0000 Subject: [PATCH] fix(mmc): initialises response buffer with zeros if ops->send_cmd in mmc_send_cmd returns a non-zero value, r_data (resp_data in mmc_device_state) is never populated, so the while condition in mmc_device_state would end up reading the uninitialized resp_data buffer Signed-off-by: Anand Saminathan Change-Id: I72d752867c537d49e111e6d149c3cca122f7dc9f --- drivers/mmc/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 57f474820..b51e74436 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -83,7 +83,7 @@ static int mmc_send_cmd(unsigned int idx, unsigned int arg, static int mmc_device_state(void) { int retries = MMC_DEFAULT_MAX_RETRIES; - unsigned int resp_data[4]; + unsigned int resp_data[4] = {0}; do { int ret;