Skip to content

Commit

Permalink
powerpc/kernel: Add missing of_node_put() in legacy_serial.c
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
windhl authored and mpe committed Sep 5, 2022
1 parent 0dd8d2c commit d1aabbb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/legacy_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d1aabbb

Please sign in to comment.