aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorlinzhecheng <linzhecheng@huawei.com>2018-11-20 16:34:19 +0800
committerGerd Hoffmann <kraxel@redhat.com>2018-11-27 07:47:57 +0100
commit933d2d4bf2b9d7673872e6e46bb0fa15e44191fb (patch)
tree48c26ee0a664af6bfb5f96eee673c69cbc535315 /hw
parent7ec910675929a593c9890f412125c31c578cde6e (diff)
usb-host: set ifs.detached as true if kernel driver is not active
If no kernel driver is active, we can already claim and perform I/O on it without detaching it. Signed-off-by: linzhecheng <linzhecheng@huawei.com> Message-id: 20181120083419.17716-1-linzhecheng@huawei.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/host-libusb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index f31e9cbbb8..b6602ded4e 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -1120,6 +1120,9 @@ static void usb_host_detach_kernel(USBHostDevice *s)
rc = libusb_kernel_driver_active(s->dh, i);
usb_host_libusb_error("libusb_kernel_driver_active", rc);
if (rc != 1) {
+ if (rc == 0) {
+ s->ifs[i].detached = true;
+ }
continue;
}
trace_usb_host_detach_kernel(s->bus_num, s->addr, i);