USB: fix regression occurring during device removal
commit042fe1a2805b175b318db0fa10cf8c9df192fa7c
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 1 Jul 2011 20:43:02 +0000 (1 16:43 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 9 Jul 2011 06:15:37 +0000 (8 23:15 -0700)
treefb17ac6c02c7c8805edc9c4194656d683af6a9a7
parent8c603fc5c6608bac3e3df537f8f4a70a24e4edd0
USB: fix regression occurring during device removal

commit e534c5b831c8b8e9f5edee5c8a37753c808b80dc upstream.

This patch (as1476) fixes a regression introduced by
fccf4e86200b8f5edd9a65da26f150e32ba79808 (USB: Free bandwidth when
usb_disable_device is called).  usb_disconnect() grabs the
bandwidth_mutex before calling usb_disable_device(), which calls down
indirectly to usb_set_interface(), which tries to acquire the
bandwidth_mutex.

The fix causes usb_set_interface() to return early when it is called
for an interface that has already been unregistered, which is what
happens in usb_disable_device().

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