From: Mauro Carvalho Chehab Date: Wed, 9 Nov 2005 05:38:16 +0000 (-0800) Subject: [PATCH] v4l: 864: improved isoc error detection X-Git-Tag: firefly_0821_release~40298 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=feff0485ebcf05b5af8a3c82aa5c361d9f8b6e75;p=firefly-linux-kernel-4.4.55.git [PATCH] v4l: 864: improved isoc error detection - Improved isoc error detection. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index 263b6c91adb5..442d50d7f320 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c @@ -573,8 +573,16 @@ static inline void em2820_isoc_video_copy(struct em2820 *dev, if ((*f)->fieldbytesused + len > dev->field_size) len =dev->field_size - (*f)->fieldbytesused; + + if (buf[0] != 0x88 && buf[0] != 0x22) { + em2820_isocdbg("frame is not complete\n"); + startread = buf; + len+=4; + } else + startread = buf + 4; + remain = len; - startread = buf + 4; + if ((*f)->top_field) fieldstart = (*f)->bufmem; else @@ -653,7 +661,8 @@ void em2820_isocIrq(struct urb *urb, struct pt_regs *regs) em2820_isocdbg("data error: [%d] len=%d, status=%d", i, urb->iso_frame_desc[i].actual_length, urb->iso_frame_desc[i].status); - continue; + if (urb->iso_frame_desc[i].status != -EPROTO) + continue; } if (urb->iso_frame_desc[i].actual_length <= 0) { em2820_isocdbg("packet %d is empty",i);