V4L/DVB: tm6000: bugfix incorrect size
authorStefan Ringel <stefan.ringel@arcor.de>
Wed, 19 May 2010 16:58:24 +0000 (13:58 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 1 Jun 2010 04:21:58 +0000 (01:21 -0300)
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/tm6000/tm6000-video.c

index f2b7fe4..2adf3cc 100644 (file)
@@ -205,7 +205,11 @@ static int copy_packet(struct urb *urb, u32 header, u8 **ptr, u8 *endp,
                c = (header >> 24) & 0xff;
 
                /* split the header fields */
-               size  = (((header & 0x7e) << 1) -1) *4;
+               size  = ((header & 0x7e) << 1);
+
+               if (size > 0)
+                       size -= 4;
+
                block = (header >> 7) & 0xf;
                field = (header >> 11) & 0x1;
                line  = (header >> 12) & 0x1ff;