From 1c1ddb052494b49a5dd1ab77294028c885753b28 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 7 Aug 2024 15:15:21 +0200 Subject: Merging upstream version 6.9.10. Signed-off-by: Daniel Baumann --- drivers/usb/core/of.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/usb/core/of.c') diff --git a/drivers/usb/core/of.c b/drivers/usb/core/of.c index f1a499ee48..763e4122ed 100644 --- a/drivers/usb/core/of.c +++ b/drivers/usb/core/of.c @@ -84,9 +84,12 @@ static bool usb_of_has_devices_or_graph(const struct usb_device *hub) if (of_graph_is_present(np)) return true; - for_each_child_of_node(np, child) - if (of_property_present(child, "reg")) + for_each_child_of_node(np, child) { + if (of_property_present(child, "reg")) { + of_node_put(child); return true; + } + } return false; } -- cgit v1.2.3