Skip to content

Commit 28a0b09

Browse files
windhlbebarino
authored andcommitted
clk: nomadik: Add missing of_node_put()
In nomadik_src_init(), of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when it is not used anymore. Signed-off-by: Liang He <windhl@126.com> Link: https://lore.kernel.org/r/20220617014308.4001511-1-windhl@126.com Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 568035b commit 28a0b09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/clk/clk-nomadik.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void __init nomadik_src_init(void)
9999
if (!src_base) {
100100
pr_err("%s: must have src parent node with REGS (%pOFn)\n",
101101
__func__, np);
102-
return;
102+
goto out_put;
103103
}
104104

105105
/* Set all timers to use the 2.4 MHz TIMCLK */
@@ -132,6 +132,9 @@ static void __init nomadik_src_init(void)
132132
}
133133
writel(val, src_base + SRC_XTALCR);
134134
register_reboot_notifier(&nomadik_clk_reboot_notifier);
135+
136+
out_put:
137+
of_node_put(np);
135138
}
136139

137140
/**

0 commit comments

Comments
 (0)