Thread (1 message) 1 message, 1 author, 2018-09-17

[PATCH 4.18 124/158] MIPS: Octeon: add missing of_node_put()

flat view
DORMANTno replies

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2018-09-17 23:13:30
Also in: lkml, stable
Subsystem: mips, the rest · Maintainers: Thomas Bogendoerfer, Linus Torvalds

4.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nicholas Mc Guire <redacted>

[ Upstream commit b1259519e618d479ede8a0db5474b3aff99f5056 ]

The call to of_find_node_by_name returns a node pointer with refcount
incremented thus it must be explicitly decremented here after the last
usage.

Signed-off-by: Nicholas Mc Guire <redacted>
Signed-off-by: Paul Burton <redacted>
Patchwork: https://patchwork.linux-mips.org/patch/19558/
Cc: Ralf Baechle <redacted>
Cc: James Hogan <jhogan@kernel.org>
Cc: <redacted>
Cc: <redacted>
Signed-off-by: Sasha Levin <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/mips/cavium-octeon/octeon-platform.c |    2 ++
 1 file changed, 2 insertions(+)
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -322,6 +322,7 @@ static int __init octeon_ehci_device_ini
 		return 0;
 
 	pd = of_find_device_by_node(ehci_node);
+	of_node_put(ehci_node);
 	if (!pd)
 		return 0;
 
@@ -384,6 +385,7 @@ static int __init octeon_ohci_device_ini
 		return 0;
 
 	pd = of_find_device_by_node(ohci_node);
+	of_node_put(ohci_node);
 	if (!pd)
 		return 0;
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help