summaryrefslogtreecommitdiffstats
path: root/drivers/fpga/socfpga-a10.c
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2017-12-08 18:37:00 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-18 15:59:16 +0100
commitd9cc5a0edb705ced4ce91b4c6ee73ec6f5bfa49a (patch)
treeef9dc53ec47e5fa5217452238857d4b6bc9263e2 /drivers/fpga/socfpga-a10.c
parentmei: speed up the power down flow (diff)
downloadlinux-d9cc5a0edb705ced4ce91b4c6ee73ec6f5bfa49a.tar.xz
linux-d9cc5a0edb705ced4ce91b4c6ee73ec6f5bfa49a.zip
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>
Diffstat (limited to '')
-rw-r--r--drivers/fpga/socfpga-a10.c8
1 files changed, 7 insertions, 1 deletions
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)