host-libusb: Correct test for USB packet state
PATCH 1/1 host-libusb: Correct test for USB packet state
USB_RET_ASYNC is -6, so inflight was always false.
Signed-off-by Ed Maste <[email protected]>
--- hw/usb/host-libusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/host-libusb.c +1 -1
@@ -384,7 +384,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 ;
Signature · 1 line
1.7.11.5
Quoted 1 line · Ed Maste
USB_RET_ASYNCis -6, so inflight was always false.
Ping. I believe the "if (inflight)" block in usb_host_req_abort() can never be executed in the current code.
Quoted 20 lines
Signed-off-by Ed Maste <[email protected]>--- hw/usb/host-libusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/usb/host-libusb.c +1
-2@@ -384,7 +384,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 ; --1.7.11.5
Quoted 5 lines · Ed Maste
Quoted 1 line · Ed Maste
USB_RET_ASYNCis -6, so inflight was always false.Ping. I believe the "if (inflight)" block in
usb_host_req_abort()can never be executed in the current code.
Patch added to usb patch queue.
thanks,
Gerd