aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-02-26 16:14:47 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-02-27 13:37:37 +0100
commite64722108c1342d499d408c386ce65794c44dd63 (patch)
tree8adeb378ab7762828cf118e08ce187a8b8fa0869
parentd86b8853e1f0c7ffb917a7a48f2e44bc3d8e9f8a (diff)
usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint
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>
-rw-r--r--usb-redir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usb-redir.c b/usb-redir.c
index d9054633aa..755492f379 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -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);