usb-host: fix host close
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 28 Oct 2011 14:13:50 +0000 (16:13 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 1 Nov 2011 15:38:36 +0000 (16:38 +0100)
commit5fafa0b6cb1a558e5702d30901aa2696cd241113
treec2bb9f68615d8e7ef1d7f7685e8a794f11f1ab9e
parentdb49817a2ddc1fceec588c4dc6e20692b0ac9e03
usb-host: fix host close

The whole usb_host_close() function is skipped in case the device is not
in attached state.  This is wrong though, only then usb_device_detach()
must be skipped, all other cleanup (especially device reset and closing
the file handle) still needs to be done.  There are code paths where
usb_host_close() is called with the device in detached state already.

This fixes usb-host devices not being released and returned to the host
after removing them with device_del.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-linux.c