Commit 21b22284 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Ulf Hansson

mmc: sdhci-pxav2: add error handling of clk_prepare_enable()

There is no check if clk_prepare_enable() succeed in sdhci_pxav2_probe().

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent bb11eff1
...@@ -185,7 +185,11 @@ static int sdhci_pxav2_probe(struct platform_device *pdev) ...@@ -185,7 +185,11 @@ static int sdhci_pxav2_probe(struct platform_device *pdev)
goto err_clk_get; goto err_clk_get;
} }
pltfm_host->clk = clk; pltfm_host->clk = clk;
clk_prepare_enable(clk); ret = clk_prepare_enable(clk);
if (ret) {
dev_err(&pdev->dev, "failed to enable io clock\n");
goto err_clk_enable;
}
host->quirks = SDHCI_QUIRK_BROKEN_ADMA host->quirks = SDHCI_QUIRK_BROKEN_ADMA
| SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
...@@ -228,6 +232,7 @@ static int sdhci_pxav2_probe(struct platform_device *pdev) ...@@ -228,6 +232,7 @@ static int sdhci_pxav2_probe(struct platform_device *pdev)
err_add_host: err_add_host:
clk_disable_unprepare(clk); clk_disable_unprepare(clk);
err_clk_enable:
clk_put(clk); clk_put(clk);
err_clk_get: err_clk_get:
sdhci_pltfm_free(pdev); sdhci_pltfm_free(pdev);
......
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