USB: Prepare for refactoring by adding extra udev checks.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Fri, 8 Mar 2013 00:23:34 +0000 (16:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Mar 2013 18:26:37 +0000 (11:26 -0700)
commit1d4b0111773fea4159e056aa8384d561c5d0fe0e
tree73ece2ec875ee303d1dbbb306d778efc2d5f8c75
parent4b996365813db4759bf923cec9647e92ca1c213d
USB: Prepare for refactoring by adding extra udev checks.

[This is upstream commit 2d4fa940f99663c82ba55b2244638833b388e4e2.
It needs to be backported to kernels as old as 3.2, because it fixes the
buggy commit 65bdac5effd15d6af619b3b7218627ef4d84ed6a "USB: Handle warm
reset failure on empty port."]

The next patch will refactor the hub port code to rip out the recursive
call to hub_port_reset on a failed hot reset.  In preparation for that,
make sure all code paths can deal with being called with a NULL udev.
The usb_device will not be valid if warm reset was issued because a port
transitioned to the Inactive or Compliance Mode on a device connect.

This patch should have no effect on current behavior.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c