]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
V4L/DVB: gspca - ov534: Fix end of frame handling
authorAntonio Ospite <ospite@studenti.unina.it>
Sun, 17 Jan 2010 06:42:14 +0000 (03:42 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 26 Feb 2010 18:10:47 +0000 (15:10 -0300)
Fix a regression, introduced in the driver split, which made
the ov534 driver unusable.
Plus, the debug message should reflect that we discard also packets
beyond the expected frame size.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/ov534.c

index c02784bbe95a6fe08f22e3c279333e09b61d4152..957e05e2d08fbbf3944beec9c2fd76cc18d88808 100644 (file)
@@ -992,9 +992,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
                        frame = gspca_get_i_frame(gspca_dev);
                        if (frame == NULL)
                                goto discard;
-                       if (frame->data_end - frame->data !=
+                       if (frame->data_end - frame->data + (len - 12) !=
                            gspca_dev->width * gspca_dev->height * 2) {
-                               PDEBUG(D_PACK, "short frame");
+                               PDEBUG(D_PACK, "wrong sized frame");
                                goto discard;
                        }
                        gspca_frame_add(gspca_dev, LAST_PACKET,