From: narmstrong@baylibre.com (Neil Armstrong)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH] spi: meson-axg: Fix error handling in meson_spicc_probe()
Date: Thu, 26 Apr 2018 10:35:33 +0200 [thread overview]
Message-ID: <a2a9cde3-5192-ce05-cc5c-d0191f0e811a@baylibre.com> (raw)
In-Reply-To: <1523655586-4163-1-git-send-email-khoroshilov@ispras.ru>
Hi Alexey,
On 13/04/2018 23:39, Alexey Khoroshilov wrote:
> If devm_spi_register_master() fails in meson_spicc_probe(),
> spicc->core is left undisabled. The patch fixes that.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> ---
> drivers/spi/spi-meson-spicc.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c
> index 5c82910e3480..7fe4488ace57 100644
> --- a/drivers/spi/spi-meson-spicc.c
> +++ b/drivers/spi/spi-meson-spicc.c
> @@ -574,10 +574,15 @@ static int meson_spicc_probe(struct platform_device *pdev)
> master->max_speed_hz = rate >> 2;
>
> ret = devm_spi_register_master(&pdev->dev, master);
> - if (!ret)
> - return 0;
> + if (ret) {
> + dev_err(&pdev->dev, "spi master registration failed\n");
> + goto out_clk;
> + }
>
> - dev_err(&pdev->dev, "spi master registration failed\n");
> + return 0;
> +
> +out_clk:
> + clk_disable_unprepare(spicc->core);
>
> out_master:
> spi_master_put(master);
>
The correct subject should be "spi: meson-spicc:"
Apart that :
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Neil
next prev parent reply other threads:[~2018-04-26 8:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 21:39 Alexey Khoroshilov
2018-04-26 8:35 ` Neil Armstrong [this message]
2018-04-28 22:46 ` [PATCH v2] spi: meson-spicc: " Alexey Khoroshilov
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=a2a9cde3-5192-ce05-cc5c-d0191f0e811a@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=linus-amlogic@lists.infradead.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®