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

Commit ae6baa8c authored by Paul Cercueil's avatar Paul Cercueil Committed by Greg Kroah-Hartman
Browse files

clk: ingenic/jz4770: Exit with error if CGU init failed



commit c067b46d731a764fc46ecc466c2967088c97089e upstream.

Exit jz4770_cgu_init() if the 'cgu' pointer we get is NULL, since the
pointer is passed as argument to functions later on.

Fixes: 7a01c190 ("clk: Add Ingenic jz4770 CGU driver")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lkml.kernel.org/r/20200213161952.37460-1-paul@crapouillou.net


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cdfa83e1
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -436,8 +436,10 @@ static void __init jz4770_cgu_init(struct device_node *np)


	cgu = ingenic_cgu_new(jz4770_cgu_clocks,
	cgu = ingenic_cgu_new(jz4770_cgu_clocks,
			      ARRAY_SIZE(jz4770_cgu_clocks), np);
			      ARRAY_SIZE(jz4770_cgu_clocks), np);
	if (!cgu)
	if (!cgu) {
		pr_err("%s: failed to initialise CGU\n", __func__);
		pr_err("%s: failed to initialise CGU\n", __func__);
		return;
	}


	retval = ingenic_cgu_register_clocks(cgu);
	retval = ingenic_cgu_register_clocks(cgu);
	if (retval)
	if (retval)