summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/dw_mmc-starfive.c
diff options
context:
space:
mode:
authorWilliam Qiu <william.qiu@starfivetech.com>2023-03-07 05:46:46 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2023-03-09 17:33:51 +0300
commit92771cdd90de64b15e65f3c88d6c6199bd5f33f5 (patch)
treeb2d869e2debb97526abeea130a067f6f49162f3f /drivers/mmc/host/dw_mmc-starfive.c
parent11440da77d6020831ee6f9ce4551b545dea789ee (diff)
downloadlinux-92771cdd90de64b15e65f3c88d6c6199bd5f33f5.tar.xz
mmc: dw_mmc-starfive: Fix initialization of prev_err
Fix a bug by making sure prev_err doesn't get used when being uninitialized. Signed-off-by: William Qiu <william.qiu@starfivetech.com> Reported-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com> Fixes: 9e622229bbf4 ("mmc: starfive: Add sdio/emmc driver support") Link: https://lore.kernel.org/r/20230307024646.10216-3-william.qiu@starfivetech.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/dw_mmc-starfive.c')
-rw-r--r--drivers/mmc/host/dw_mmc-starfive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/host/dw_mmc-starfive.c b/drivers/mmc/host/dw_mmc-starfive.c
index 40f5969b07a6..dab1508bf83c 100644
--- a/drivers/mmc/host/dw_mmc-starfive.c
+++ b/drivers/mmc/host/dw_mmc-starfive.c
@@ -51,7 +51,7 @@ static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot,
struct dw_mci *host = slot->host;
struct starfive_priv *priv = host->priv;
int rise_point = -1, fall_point = -1;
- int err, prev_err;
+ int err, prev_err = 0;
int i;
bool found = 0;
u32 regval;