Skip to content

Commit 173940b

Browse files
windhljcmvbkbc
authored andcommitted
xtensa: xtfpga: Fix refcount leak bug in setup
In machine_setup(), 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: stable@vger.kernel.org Signed-off-by: Liang He <windhl@126.com> Message-Id: <20220617115323.4046905-1-windhl@126.com> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
1 parent a0117dc commit 173940b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • arch/xtensa/platforms/xtfpga

arch/xtensa/platforms/xtfpga/setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ static int __init machine_setup(void)
133133

134134
if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
135135
update_local_mac(eth);
136+
of_node_put(eth);
136137
return 0;
137138
}
138139
arch_initcall(machine_setup);

0 commit comments

Comments
 (0)