Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9cc5a0e authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Greg Kroah-Hartman
Browse files

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: default avatarMoritz Fischer <mdf@kernel.org>
Signed-off-by: default avatarAlan Tull <atull@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8d52af67
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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)