Thread (1 message) 1 message, 1 author, 2022-08-14

[PATCH AUTOSEL 5.10 08/31] usb: host: ohci-ppc-of: Fix refcount leak bug

flat view
DORMANTno replies REVIEWED: 1 (1M)

From: Sasha Levin <sashal@kernel.org>
Date: 2022-08-14 15:49:27
Also in: lkml, stable
Subsystem: the rest, usb ohci driver, usb subsystem · Maintainers: Linus Torvalds, Alan Stern, Greg Kroah-Hartman

1 review trailer (1 from subsystem maintainers).

From: Liang He <redacted>

[ Upstream commit 40a959d7042bb7711e404ad2318b30e9f92c6b9b ]

In ohci_hcd_ppc_of_probe(), of_find_compatible_node() will return
a node pointer with refcount incremented. We should use of_node_put()
when it is not used anymore.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Liang He <redacted>
Link: https://lore.kernel.org/r/20220617034637.4003115-1-windhl@126.com (local)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/host/ohci-ppc-of.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c
index 45f7cceb6df3..98e46725999e 100644
--- a/drivers/usb/host/ohci-ppc-of.c
+++ b/drivers/usb/host/ohci-ppc-of.c
@@ -169,6 +169,7 @@ static int ohci_hcd_ppc_of_probe(struct platform_device *op)
 				release_mem_region(res.start, 0x4);
 		} else
 			pr_debug("%s: cannot get ehci offset from fdt\n", __FILE__);
+		of_node_put(np);
 	}
 
 	irq_dispose_mapping(irq);
-- 
2.35.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help