summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/of.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/of.c')
-rw-r--r--drivers/usb/core/of.c7
1 files changed, 5 insertions, 2 deletions
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;
}