public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] patch for FPGA
@ 2017-12-08 17:36 Alan Tull
  2017-12-08 17:37 ` [PATCH] fpga: socfpga-a10: disable clk on error in socfpga_a10_fpga_probe() Alan Tull
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Tull @ 2017-12-08 17:36 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Moritz Fischer, Alan Tull, linux-kernel, linux-fpga

Hi Greg,

Please take this one small fix for fpga.  It's been reviewed on
the mailing list.  It applies cleanly on linux-next/master.

Thanks,
Alan

Alexey Khoroshilov (1):
  fpga: socfpga-a10: disable clk on error in socfpga_a10_fpga_probe()

 drivers/fpga/socfpga-a10.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] fpga: socfpga-a10: disable clk on error in socfpga_a10_fpga_probe()
  2017-12-08 17:36 [PATCH] patch for FPGA Alan Tull
@ 2017-12-08 17:37 ` Alan Tull
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Tull @ 2017-12-08 17:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Moritz Fischer, Alan Tull, linux-kernel, linux-fpga,
	Alexey Khoroshilov

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-08 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-08 17:36 [PATCH] patch for FPGA Alan Tull
2017-12-08 17:37 ` [PATCH] fpga: socfpga-a10: disable clk on error in socfpga_a10_fpga_probe() Alan Tull

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox