Skip to content

Commit d9cc5a0

Browse files
khoroshilovgregkh
authored andcommitted
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>
1 parent 8d52af6 commit d9cc5a0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎drivers/fpga/socfpga-a10.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,14 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev)
519519
return -EBUSY;
520520
}
521521

522-
return fpga_mgr_register(dev, "SoCFPGA Arria10 FPGA Manager",
522+
ret = fpga_mgr_register(dev, "SoCFPGA Arria10 FPGA Manager",
523523
&socfpga_a10_fpga_mgr_ops, priv);
524+
if (ret) {
525+
clk_disable_unprepare(priv->clk);
526+
return ret;
527+
}
528+
529+
return 0;
524530
}
525531

526532
static int socfpga_a10_fpga_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)