summaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorLiang He <windhl@126.com>2022-06-17 19:53:23 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-02 16:27:36 +0200
commit0715d0e60052662c3f225342062f174dd721d1c7 (patch)
treecd8d8a8ee00f671adde0adcb5d0c34737769b830 /arch/xtensa
parent47f75a0b067c46415b2c523e5e9111d0f8022d33 (diff)
downloadlinux-stable-0715d0e60052662c3f225342062f174dd721d1c7.tar.gz
linux-stable-0715d0e60052662c3f225342062f174dd721d1c7.tar.bz2
linux-stable-0715d0e60052662c3f225342062f174dd721d1c7.zip
xtensa: xtfpga: Fix refcount leak bug in setup
commit 173940b3ae40114d4179c251a98ee039dc9cd5b3 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/platforms/xtfpga/setup.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c
index db5122765f16..ce00dc2b3a1e 100644
--- a/arch/xtensa/platforms/xtfpga/setup.c
+++ b/arch/xtensa/platforms/xtfpga/setup.c
@@ -152,6 +152,7 @@ static int __init machine_setup(void)
if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
update_local_mac(eth);
+ of_node_put(eth);
return 0;
}
arch_initcall(machine_setup);