Re-attach usb device to kernel while usb_host_open fails

Signed-off-by: Lin Ma <lma@suse.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Lin Ma 2015-06-24 13:40:11 +08:00 committed by Gerd Hoffmann
parent 2d5ee9e7a7
commit 6110ce59af

View File

@ -889,6 +889,9 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev)
fail:
trace_usb_host_open_failure(bus_num, addr);
if (s->dh != NULL) {
usb_host_release_interfaces(s);
libusb_reset_device(s->dh);
usb_host_attach_kernel(s);
libusb_close(s->dh);
s->dh = NULL;
s->dev = NULL;