USB: ulpi: fix bus-node lookup
authorJohan Hovold <johan@kernel.org>
Sat, 11 Nov 2017 15:31:18 +0000 (16:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 14:17:48 +0000 (15:17 +0100)
commit33c309ebc797b908029fd3a0851aefe697e9b598
tree7805e2471a8d44fca4b9cc679a9bc9b2c2bed5f3
parent446f666da9f019ce2ffd03800995487e79a91462
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")
Reported-by: Peter Robinson <pbrobinson@gmail.com>
Reported-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: stable <stable@vger.kernel.org> # 4.10
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/common/ulpi.c