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 <anans@google.com>
Change-Id: I72d752867c537d49e111e6d149c3cca122f7dc9f
This commit is contained in:
Anand Saminathan 2023-09-16 10:31:56 +00:00
parent cc933e1d12
commit b1a2c51a08

View file

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