blob: 69cdf8fe842f81b73454297c6d5502ebfec1e5b8 [file] [log] [blame]
From a2fc900d2c9441c2dcc5f907140c3298e5117f14 Mon Sep 17 00:00:00 2001
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Fri, 8 Dec 2017 11:37:00 -0600
Subject: [PATCH 1681/1795] fpga: socfpga-a10: disable clk on error in
socfpga_a10_fpga_probe()
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d9cc5a0edb705ced4ce91b4c6ee73ec6f5bfa49a)
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
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.19.0