]> Git Repo - linux.git/commitdiff
mmc: sdhci: Fix a potential uninitialized variable
authorDan Carpenter <[email protected]>
Tue, 14 Jul 2020 14:14:10 +0000 (17:14 +0300)
committerUlf Hansson <[email protected]>
Fri, 24 Jul 2020 09:51:40 +0000 (11:51 +0200)
Smatch complains that "ret" can be used without being initialized.

drivers/mmc/host/sdhci.c
  4383          if (!IS_ERR(mmc->supply.vqmmc)) {
  4384                  if (enable_vqmmc) {
                            ^^^^^^^^^^^^
  4385                          ret = regulator_enable(mmc->supply.vqmmc);
                                ^^^^^
  4386                          host->sdhci_core_to_disable_vqmmc = !ret;
  4387                  }

"ret" is only initialized when "enable_vqmmc" is true.

Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/20200714141410.GB314989@mwanda
Signed-off-by: Ulf Hansson <[email protected]>
drivers/mmc/host/sdhci.c

index d3b62fc5c661b664aaace8403307dd8444e30802..3d272063d785bf18a34c7fb1155f02900873ffc7 100644 (file)
@@ -4104,7 +4104,7 @@ int sdhci_setup_host(struct sdhci_host *host)
        unsigned int ocr_avail;
        unsigned int override_timeout_clk;
        u32 max_clk;
-       int ret;
+       int ret = 0;
        bool enable_vqmmc = false;
 
        WARN_ON(host == NULL);
This page took 0.06018 seconds and 4 git commands to generate.