Browse Source

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
pull/2003/head
Anand Saminathan 1 year ago
parent
commit
b1a2c51a08
  1. 2
      drivers/mmc/mmc.c

2
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) static int mmc_device_state(void)
{ {
int retries = MMC_DEFAULT_MAX_RETRIES; int retries = MMC_DEFAULT_MAX_RETRIES;
unsigned int resp_data[4]; unsigned int resp_data[4] = {0};
do { do {
int ret; int ret;

Loading…
Cancel
Save