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>
Sun, 10 Dec 2017 12:40:44 +0000 (13:40 +0100)
commit8bc546bbfec9be32108af2684a2766629acc052d
tree21f360c59ded2cca5506737ed2cf2e317f9ccb1f
parent755532dd5f643f1a1da479bb133a946ce5c97905
USB: ulpi: fix bus-node lookup

commit 33c309ebc797b908029fd3a0851aefe697e9b598 upstream.

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>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/common/ulpi.c