From: Laurent Pinchart Date: Sat, 14 Feb 2009 22:39:08 +0000 (-0300) Subject: V4L/DVB (10651): uvcvideo: Ignore empty bulk URBs X-Git-Tag: v3.12-rc1~15594^2~469 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c90e777976f6237a0cdb644c6a9406907939b174;p=kernel%2Fkernel-generic.git V4L/DVB (10651): uvcvideo: Ignore empty bulk URBs 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index 9139086..0789ba38 100644 --- a/drivers/media/video/uvc/uvc_video.c +++ b/drivers/media/video/uvc/uvc_video.c @@ -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;