From: Mauro Carvalho Chehab Date: Wed, 30 Jun 2010 20:24:28 +0000 (-0300) Subject: V4L/DVB: tm6000: Partially revert some copybuf logic X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ccfb30288228aaaf40a849bffe434bc9eb46b23c;p=openwrt%2Fstaging%2Fblogic.git V4L/DVB: tm6000: Partially revert some copybuf logic Partially revert changeset 0208bef609242a2d50b95edc713a41566cae500b: As pointed by Stefan Ringel , many packets become damaged by this change. That means that the "size" field of Video/VBI is not presenting 180 bytes, as it should be expected. Thanks-to: Stefan Ringel Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c index fd36b36407c5..ce0a089a0771 100644 --- a/drivers/staging/tm6000/tm6000-video.c +++ b/drivers/staging/tm6000/tm6000-video.c @@ -314,7 +314,7 @@ static int copy_streams(u8 *data, unsigned long len, break; } } - if (cpysize < size) { + if (ptr + pktsize > endp) { /* End of URB packet, but cmd processing is not * complete. Preserve the state for a next packet */ @@ -322,7 +322,7 @@ static int copy_streams(u8 *data, unsigned long len, dev->isoc_ctl.size = size - cpysize; dev->isoc_ctl.cmd = cmd; dev->isoc_ctl.pktsize = pktsize - (endp - ptr); - ptr += cpysize; + ptr += endp - ptr; } else { dev->isoc_ctl.cmd = 0; ptr += pktsize;