]> git.itanic.dy.fi Git - linux-stable/commitdiff
powerpc/kernel: Add missing of_node_put() in legacy_serial.c
authorLiang He <windhl@126.com>
Sun, 19 Jun 2022 07:08:11 +0000 (15:08 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 5 Sep 2022 07:28:26 +0000 (17:28 +1000)
In find_legacy_serial_ports(), of_find_node_by_path() will return a node
pointer with refcount incremented. The reference should be dropped with
of_node_put() when it is not used anymore.

Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220619070811.4067215-1-windhl@126.com
arch/powerpc/kernel/legacy_serial.c

index 5c58460b269ac3f6057cbd026e97dcb35053d707..f048c424c525b0a735fe3f8503873d72a9049c0b 100644 (file)
@@ -471,6 +471,8 @@ void __init find_legacy_serial_ports(void)
        }
 #endif
 
+       of_node_put(stdout);
+
        DBG("legacy_serial_console = %d\n", legacy_serial_console);
        if (legacy_serial_console >= 0)
                setup_legacy_serial_console(legacy_serial_console);