From: Liang He Date: Fri, 1 Jul 2022 12:41:12 +0000 (+0800) Subject: mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start X-Git-Tag: v6.6.17~6857^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a9f743ceead60ed454c46fbc3085ee9a79cbebb;p=platform%2Fkernel%2Flinux-rpi.git mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start 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 Signed-off-by: Thomas Bogendoerfer --- diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c index a994022..ce05c0d 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; }