Commit 173940b3 authored by Liang He's avatar Liang He Committed by Max Filippov

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: default avatarLiang He <windhl@126.com>
Message-Id: <20220617115323.4046905-1-windhl@126.com>
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
parent a0117dc9
...@@ -133,6 +133,7 @@ static int __init machine_setup(void) ...@@ -133,6 +133,7 @@ static int __init machine_setup(void)
if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc"))) if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
update_local_mac(eth); update_local_mac(eth);
of_node_put(eth);
return 0; return 0;
} }
arch_initcall(machine_setup); arch_initcall(machine_setup);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment