浏览代码

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 <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Laurent Pinchart 16 年之前
父节点
当前提交
c90e777976
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/media/video/uvc/uvc_video.c

+ 3 - 0
drivers/media/video/uvc/uvc_video.c

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