Patchwork [3/8] usb-redir: Only add actually in flight packets to the in flight queue

login
register
mail settings
Submitter Hans de Goede
Date Nov. 6, 2012, 2:08 p.m.
Message ID <1352210901-1923-4-git-send-email-hdegoede@redhat.com>
Download mbox | patch
Permalink /patch/197486/
State New
Headers show

Comments

Hans de Goede - Nov. 6, 2012, 2:08 p.m.
Packets which have queued up, but not yet handed over to the device, are
*not* in flight.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 hw/usb/redirect.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index b61bb6e..ad601d8 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -352,7 +352,9 @@  static void usbredir_fill_already_in_flight_from_ep(USBRedirDevice *dev,
         if (p->combined && p != p->combined->first) {
             continue;
         }
-        packet_id_queue_add(&dev->already_in_flight, p->id);
+        if (p->state == USB_PACKET_ASYNC) {
+            packet_id_queue_add(&dev->already_in_flight, p->id);
+        }
     }
 }