summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/uvc
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@skynet.be>2009-02-14 23:39:08 +0100
committerLaurent Pinchart <laurent.pinchart@skynet.be>2009-02-14 23:39:08 +0100
commite2a760f26ff7124de2bc6bed4647962dd7078d1b (patch)
tree28066a051388762e4b4caa642da63d201dc6ba18 /linux/drivers/media/video/uvc
parentbdff40c8e0a3b0971c67f28db1b0f9b2fe581313 (diff)
downloadmediapointer-dvb-s2-e2a760f26ff7124de2bc6bed4647962dd7078d1b.tar.gz
mediapointer-dvb-s2-e2a760f26ff7124de2bc6bed4647962dd7078d1b.tar.bz2
uvcvideo: Ignore empty bulk URBs
From: Laurent Pinchart <laurent.pinchart@skynet.be> 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. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Diffstat (limited to 'linux/drivers/media/video/uvc')
-rw-r--r--linux/drivers/media/video/uvc/uvc_video.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/drivers/media/video/uvc/uvc_video.c b/linux/drivers/media/video/uvc/uvc_video.c
index a4034ccb2..328910855 100644
--- a/linux/drivers/media/video/uvc/uvc_video.c
+++ b/linux/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;