]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
USB: usbtest - ensure correct isoc data length
authorMartin Fuzzey <mfuzzey@gmail.com>
Thu, 30 Sep 2010 22:20:48 +0000 (00:20 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 22 Oct 2010 17:22:01 +0000 (10:22 -0700)
Check the data length of isochronous transfers is
as expected.

With this test #16 will now fail if the device side
sends no data.

Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/usbtest.c

index bb078ebb8e81ab339fcf4e7e6d6efa99dd2dca53..a35b427c0bac59ce6965b37d28c6a8748ae03dd5 100644 (file)
@@ -1371,6 +1371,8 @@ static void iso_callback(struct urb *urb)
                ctx->errors += urb->error_count;
        else if (urb->status != 0)
                ctx->errors += urb->number_of_packets;
+       else if (urb->actual_length != urb->transfer_buffer_length)
+               ctx->errors++;
 
        if (urb->status == 0 && ctx->count > (ctx->pending - 1)
                        && !ctx->submit_error) {