]> git.proxmox.com Git - mirror_qemu.git/commitdiff
usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint
authorHans de Goede <hdegoede@redhat.com>
Sun, 26 Feb 2012 15:14:47 +0000 (16:14 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 27 Feb 2012 12:37:37 +0000 (13:37 +0100)
We should return USB_RET_NAK, rather then a 0 sized packet, when we've no data
for an interrupt IN endpoint.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-redir.c

index d9054633aaf82cc58c722c72757b775e37dcb634..755492f37998539162f9f76b327e5350a2453ff3 100644 (file)
@@ -548,7 +548,10 @@ static int usbredir_handle_interrupt_data(USBRedirDevice *dev,
             /* Check interrupt_error for stream errors */
             status = dev->endpoint[EP2I(ep)].interrupt_error;
             dev->endpoint[EP2I(ep)].interrupt_error = 0;
-            return usbredir_handle_status(dev, status, 0);
+            if (status) {
+                return usbredir_handle_status(dev, status, 0);
+            }
+            return USB_RET_NAK;
         }
         DPRINTF("interrupt-token-in ep %02X status %d len %d\n", ep,
                 intp->status, intp->len);