From: Alan Tull <atull@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Moritz Fischer <mdf@kernel.org>, Alan Tull <atull@kernel.org>,
linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org,
Alexey Khoroshilov <khoroshilov@ispras.ru>
Subject: [PATCH] fpga: socfpga-a10: disable clk on error in socfpga_a10_fpga_probe()
Date: Fri, 8 Dec 2017 11:37:00 -0600 [thread overview]
Message-ID: <1512754620-3723-2-git-send-email-atull@kernel.org> (raw)
In-Reply-To: <1512754620-3723-1-git-send-email-atull@kernel.org>
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
If fpga_mgr_register() fails, a clock is left undisabled.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Alan Tull <atull@kernel.org>
---
drivers/fpga/socfpga-a10.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/fpga/socfpga-a10.c b/drivers/fpga/socfpga-a10.c
index f8770af..a46e343 100644
--- a/drivers/fpga/socfpga-a10.c
+++ b/drivers/fpga/socfpga-a10.c
@@ -519,8 +519,14 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev)
return -EBUSY;
}
- return fpga_mgr_register(dev, "SoCFPGA Arria10 FPGA Manager",
+ ret = fpga_mgr_register(dev, "SoCFPGA Arria10 FPGA Manager",
&socfpga_a10_fpga_mgr_ops, priv);
+ if (ret) {
+ clk_disable_unprepare(priv->clk);
+ return ret;
+ }
+
+ return 0;
}
static int socfpga_a10_fpga_remove(struct platform_device *pdev)
--
2.7.4
next prev parent reply other threads:[~2017-12-08 17:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 17:36 [PATCH] patch for FPGA Alan Tull
2017-12-08 17:37 ` Alan Tull [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-12-01 20:26 [PATCH] fpga: socfpga-a10: disable clk on error in socfpga_a10_fpga_probe() Alexey Khoroshilov
2017-12-02 1:21 ` Moritz Fischer
2017-12-04 15:44 ` Alan Tull
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=1512754620-3723-2-git-send-email-atull@kernel.org \
--to=atull@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=khoroshilov@ispras.ru \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.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