Skip to content

Commit a0117dc

Browse files
windhljcmvbkbc
authored andcommitted
xtensa: Fix refcount leak bug in time.c
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]>
1 parent b13bacc commit a0117dc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/xtensa/kernel/time.c

Lines changed: 1 addition & 0 deletions
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)