]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
V4L/DVB (10651): uvcvideo: Ignore empty bulk URBs
authorLaurent Pinchart <laurent.pinchart@skynet.be>
Sat, 14 Feb 2009 22:39:08 +0000 (19:39 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:42:51 +0000 (12:42 -0300)
Devices may send a zero-length packet to signal the end of a bulk payload. If
the payload size is a multiple of the URB size the zero-length packet will be
received by the URB completion handler. Handle this by ignoring all empty URBs.

Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/uvc/uvc_video.c

index 9139086f940afef5baeb109e05bf53234d92cf59..0789ba381fc14f1598749504f46440c5c7413d1e 100644 (file)
@@ -540,6 +540,9 @@ static void uvc_video_decode_bulk(struct urb *urb,
        u8 *mem;
        int len, ret;
 
+       if (urb->actual_length == 0)
+               return;
+
        mem = urb->transfer_buffer;
        len = urb->actual_length;
        video->bulk.payload_size += len;