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; 5+ 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] 5+ messages in thread
* [PATCH] fpga: socfpga-a10: disable clk on error in socfpga_a10_fpga_probe()
@ 2017-12-01 20:26 Alexey Khoroshilov
  2017-12-02  1:21 ` Moritz Fischer
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Khoroshilov @ 2017-12-01 20:26 UTC (permalink / raw)
  To: Alan Tull, Moritz Fischer
  Cc: Alexey Khoroshilov, linux-fpga, linux-kernel, ldv-project

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>
---
 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 f8770af0f6b5..a46e343a5b72 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] 5+ messages in thread

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

Thread overview: 5+ 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
  -- strict thread matches above, loose matches on Subject: below --
2017-12-01 20:26 Alexey Khoroshilov
2017-12-02  1:21 ` Moritz Fischer
2017-12-04 15:44   ` Alan Tull

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