summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorLiang He <windhl@126.com>2022-07-01 20:41:12 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-25 11:15:45 +0200
commitc06166a484eece51916dd700a870e53356b7e1bc (patch)
treeae2524b29193dd0315b403325dd1654342e79332 /arch/mips
parentfe72beac06f59c04dfd26f78aa72788cdd770ad0 (diff)
downloadlinux-stable-c06166a484eece51916dd700a870e53356b7e1bc.tar.gz
linux-stable-c06166a484eece51916dd700a870e53356b7e1bc.tar.bz2
linux-stable-c06166a484eece51916dd700a870e53356b7e1bc.zip
mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start
[ Upstream commit 7a9f743ceead60ed454c46fbc3085ee9a79cbebb ] We should call of_node_put() for the reference 'uctl_node' returned by of_get_parent() which will increase the refcount. Otherwise, there will be a refcount leak bug. Signed-off-by: Liang He <windhl@126.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/cavium-octeon/octeon-platform.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
index 4d83f5bc7211..54c8389decda 100644
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -86,11 +86,12 @@ static void octeon2_usb_clocks_start(struct device *dev)
"refclk-frequency", &clock_rate);
if (i) {
dev_err(dev, "No UCTL \"refclk-frequency\"\n");
+ of_node_put(uctl_node);
goto exit;
}
i = of_property_read_string(uctl_node,
"refclk-type", &clock_type);
-
+ of_node_put(uctl_node);
if (!i && strcmp("crystal", clock_type) == 0)
is_crystal_clock = true;
}