Skip to content

Commit 7dba402

Browse files
Wolfram Sangstorulf
authored andcommitted
mmc: renesas_sdhi: initialize variable properly when tuning
'cmd_error' is not necessarily initialized on some error paths in mmc_send_tuning(). Initialize it. Fixes: 2c9017d ("mmc: renesas_sdhi: abort tuning when timeout detected") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent d58071a commit 7dba402

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mmc/host/renesas_sdhi_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ static int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode)
673673

674674
/* Issue CMD19 twice for each tap */
675675
for (i = 0; i < 2 * priv->tap_num; i++) {
676-
int cmd_error;
676+
int cmd_error = 0;
677677

678678
/* Set sampling clock position */
679679
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, i % priv->tap_num);

0 commit comments

Comments
 (0)