of: overlay: add missing of_node_get() in __of_attach_node_sysfs
authorFrank Rowand <frank.rowand@sony.com>
Fri, 5 Oct 2018 03:26:05 +0000 (20:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Feb 2019 16:30:15 +0000 (17:30 +0100)
commit9af27fab006134b02e7f501214f53a3b7ee03d0d
tree975920bdb7b3dff8e48665b1e811f45ff3ca144d
parent5006496fb2c8ded3a1211dcf9ee53070205ebe7f
of: overlay: add missing of_node_get() in __of_attach_node_sysfs

commit 5b2c2f5a0ea3a43e0dee78059e34c7cb54136dcc upstream.

There is a matching of_node_put() in __of_detach_node_sysfs()

Remove misleading comment from function header comment for
of_detach_node().

This patch may result in memory leaks from code that directly calls
the dynamic node add and delete functions directly instead of
using changesets.

This commit should result in powerpc systems that dynamically
allocate a node, then later deallocate the node to have a
memory leak when the node is deallocated.

The next commit will fix the leak.

Tested-by: Alan Tull <atull@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/of/dynamic.c
drivers/of/kobj.c