Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1578850 > unrolled thread

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

Started byAlexey Khoroshilov <khoroshilov@ispras.ru>
First post2017-02-11 00:00 +0100
Last post2017-02-11 00:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] mmc: sdhci-pxav2: add error handling of clk_prepare_enable() Alexey Khoroshilov <khoroshilov@ispras.ru> - 2017-02-11 00:00 +0100

#1578850 — [PATCH] mmc: sdhci-pxav2: add error handling of clk_prepare_enable()

FromAlexey Khoroshilov <khoroshilov@ispras.ru>
Date2017-02-11 00:00 +0100
Subject[PATCH] mmc: sdhci-pxav2: add error handling of clk_prepare_enable()
Message-ID<t9sky-17u-11@gated-at.bofh.it>
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>
---
 drivers/mmc/host/sdhci-pxav2.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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);
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web