Commit 7dba4028 authored by Wolfram Sang's avatar Wolfram Sang Committed by Ulf Hansson

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: 2c9017d0 ("mmc: renesas_sdhi: abort tuning when timeout detected")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20211130132309.18246-1-wsa+renesas@sang-engineering.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent d58071a8
...@@ -673,7 +673,7 @@ static int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode) ...@@ -673,7 +673,7 @@ static int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode)
/* Issue CMD19 twice for each tap */ /* Issue CMD19 twice for each tap */
for (i = 0; i < 2 * priv->tap_num; i++) { for (i = 0; i < 2 * priv->tap_num; i++) {
int cmd_error; int cmd_error = 0;
/* Set sampling clock position */ /* Set sampling clock position */
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, i % priv->tap_num); sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, i % priv->tap_num);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment