summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci-pxav2.c
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2017-02-11 01:54:46 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2017-04-24 21:41:13 +0200
commit21b22284619bbb201775c125af53f2834eb91674 (patch)
tree51091b0dcd41590d3c54ce7dbc381807b5b26bac /drivers/mmc/host/sdhci-pxav2.c
parentbb11eff1f1820b9f3bf6578af18b3d18094e7f54 (diff)
downloadtalos-op-linux-21b22284619bbb201775c125af53f2834eb91674.tar.gz
talos-op-linux-21b22284619bbb201775c125af53f2834eb91674.zip
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: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-pxav2.c')
-rw-r--r--drivers/mmc/host/sdhci-pxav2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-pxav2.c b/drivers/mmc/host/sdhci-pxav2.c
index 347eae2d7b6a..80513f54e9d4 100644
--- a/drivers/mmc/host/sdhci-pxav2.c
+++ b/drivers/mmc/host/sdhci-pxav2.c
@@ -185,7 +185,11 @@ static int sdhci_pxav2_probe(struct platform_device *pdev)
goto err_clk_get;
}
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
| SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
@@ -228,6 +232,7 @@ static int sdhci_pxav2_probe(struct platform_device *pdev)
err_add_host:
clk_disable_unprepare(clk);
+err_clk_enable:
clk_put(clk);
err_clk_get:
sdhci_pltfm_free(pdev);
OpenPOWER on IntegriCloud