Skip to content

Commit c067b46

Browse files
pcercueibebarino
authored andcommitted
clk: ingenic/jz4770: Exit with error if CGU init failed
Exit jz4770_cgu_init() if the 'cgu' pointer we get is NULL, since the pointer is passed as argument to functions later on. Fixes: 7a01c19 ("clk: Add Ingenic jz4770 CGU driver") Cc: [email protected] Signed-off-by: Paul Cercueil <[email protected]> Reported-by: kbuild test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 6673db4 commit c067b46

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/clk/ingenic/jz4770-cgu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,10 @@ static void __init jz4770_cgu_init(struct device_node *np)
432432

433433
cgu = ingenic_cgu_new(jz4770_cgu_clocks,
434434
ARRAY_SIZE(jz4770_cgu_clocks), np);
435-
if (!cgu)
435+
if (!cgu) {
436436
pr_err("%s: failed to initialise CGU\n", __func__);
437+
return;
438+
}
437439

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

0 commit comments

Comments
 (0)