diff mbox

[5/6] usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint

Message ID 1330269288-5578-5-git-send-email-hdegoede@redhat.com
State New
Headers show

Commit Message

Hans de Goede Feb. 26, 2012, 3:14 p.m. UTC
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>
---
 usb-redir.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Gerd Hoffmann Feb. 27, 2012, 11:45 a.m. UTC | #1
On 02/26/12 16:14, Hans de Goede wrote:
> +            if (status)
> +                return usbredir_handle_status(dev, status, 0);

Fails checkpatch.pl, braces needed here.

cheers,
  Gerd
Gerd Hoffmann Feb. 27, 2012, 12:15 p.m. UTC | #2
On 02/27/12 12:45, Gerd Hoffmann wrote:
> On 02/26/12 16:14, Hans de Goede wrote:
>> +            if (status)
>> +                return usbredir_handle_status(dev, status, 0);
> 
> Fails checkpatch.pl, braces needed here.

Fixed & applied (all patches).

cheers,
  Gerd
diff mbox

Patch

diff --git a/usb-redir.c b/usb-redir.c
index c76e55d..ea828a8 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -558,7 +558,9 @@  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);