Skip to content

Commit 0e403a3

Browse files
windhlgregkh
authored andcommitted
xtensa: Fix refcount leak bug in time.c
commit a0117dc upstream. In calibrate_ccount(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Cc: [email protected] Signed-off-by: Liang He <[email protected]> Message-Id: <[email protected]> Signed-off-by: Max Filippov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9b30c5c commit 0e403a3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/xtensa/kernel/time.c

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ static void __init calibrate_ccount(void)
154154
cpu = of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu");
155155
if (cpu) {
156156
clk = of_clk_get(cpu, 0);
157+
of_node_put(cpu);
157158
if (!IS_ERR(clk)) {
158159
ccount_freq = clk_get_rate(clk);
159160
return;

0 commit comments

Comments
 (0)