From: Adrian Hunter <adrian.hunter@intel.com>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
ldv-project@linuxtesting.org, Jisheng Zhang <jszhang@marvell.com>
Subject: Re: [PATCH] mmc: sdhci-pxav2: add error handling of clk_prepare_enable()
Date: Tue, 28 Feb 2017 13:55:31 +0200 [thread overview]
Message-ID: <4a7a61c9-fb1f-1c43-c018-af019576ccec@intel.com> (raw)
In-Reply-To: <1486767286-3361-1-git-send-email-khoroshilov@ispras.ru>
On 11/02/17 00:54, Alexey Khoroshilov wrote:
> 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>
> ---
> 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);
>
next prev parent reply other threads:[~2017-02-28 12:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-10 22:54 Alexey Khoroshilov
2017-02-28 11:55 ` Adrian Hunter [this message]
2017-03-14 16:21 ` Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a7a61c9-fb1f-1c43-c018-af019576ccec@intel.com \
--to=adrian.hunter@intel.com \
--cc=jszhang@marvell.com \
--cc=khoroshilov@ispras.ru \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®