Skip to contentSkip to conversation

patch "USB: ulpi: fix bus-node lookup" added to usb-linus

PATCH [email protected] 1 participant 1 message Nov 28, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

USB: ulpi: fix bus-node lookup

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From 33c309ebc797b908029fd3a0851aefe697e9b598 Mon Sep 17 00:00:00 2001

From: Johan Hovold <[email protected]>
Date: Sat, 11 Nov 2017 16:31:18 +0100
Subject: USB: ulpi: fix bus-node lookup

Fix bus-node lookup during registration, which ended up searching the whole device tree depth-first starting at the parent (or grand parent) rather than just matching on its children.

To make things worse, the parent (or grand-parent) node could end being prematurely freed as well.

Fixes ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT")
Cc stable <[email protected]> # 4.10
---
 drivers/usb/common/ulpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/common/ulpi.c +2 -2
index 8b351444cc40..9a2ab6751a23 100644
@@ -180,9 +180,9 @@ static int ulpi_of_register(struct ulpi *ulpi)
 	/* Find a ulpi bus underneath the parent or the grandparent */
 	parent = ulpi->dev.parent;
 	if (parent->of_node)
-		np = of_find_node_by_name(parent->of_node, "ulpi");
+		np = of_get_child_by_name(parent->of_node, "ulpi");
 	else if (parent->parent && parent->parent->of_node)
-		np = of_find_node_by_name(parent->parent->of_node, "ulpi");
+		np = of_get_child_by_name(parent->parent->of_node, "ulpi");
 	if (!np)
 		return 0;
 
Signature · 1 line
2.15.0