Patchwork [2/7] host-libusb: Correct test for USB packet state

login
register
mail settings
Submitter Gerd Hoffmann
Date June 3, 2013, 10:05 a.m.
Message ID <1370253951-12323-3-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/248228/
State New
Headers show

Comments

Gerd Hoffmann - June 3, 2013, 10:05 a.m.
From: Ed Maste <emaste@freebsd.org>

USB_RET_ASYNC is -6, so inflight was always false.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/host-libusb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index f3de459..3a582c5 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -385,7 +385,7 @@  out:
 static void usb_host_req_abort(USBHostRequest *r)
 {
     USBHostDevice  *s = r->host;
-    bool inflight = (r->p && r->p->state == USB_RET_ASYNC);
+    bool inflight = (r->p && r->p->state == USB_PACKET_ASYNC);
 
     if (inflight) {
         r->p->status = USB_RET_NODEV;