This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] gspca: Fix a warning for using len before filling it
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Mon Dec 27 13:00:03 2010 -0200

The check for status errors is now before the check for len. That's
ok. However, the error printk's for the status error prints the URB
length. This generates this error:

drivers/media/video/gspca/gspca.c: In function ‘fill_frame’:
drivers/media/video/gspca/gspca.c:305:9: warning: ‘len’ may be used 
uninitialized in this function

The fix is as simple as moving the len init to happen before the checks.

Cc: Jean-François Moine <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/video/gspca/gspca.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=2a9114eca3a85c231f89729cba37f28afdd1079f

diff --git a/drivers/media/video/gspca/gspca.c 
b/drivers/media/video/gspca/gspca.c
index 92b5dfb..80b31eb 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -318,6 +318,7 @@ static void fill_frame(struct gspca_dev *gspca_dev,
        }
        pkt_scan = gspca_dev->sd_desc->pkt_scan;
        for (i = 0; i < urb->number_of_packets; i++) {
+               len = urb->iso_frame_desc[i].actual_length;
 
                /* check the packet status and length */
                st = urb->iso_frame_desc[i].status;
@@ -327,7 +328,6 @@ static void fill_frame(struct gspca_dev *gspca_dev,
                        gspca_dev->last_packet_type = DISCARD_PACKET;
                        continue;
                }
-               len = urb->iso_frame_desc[i].actual_length;
                if (len == 0) {
                        if (gspca_dev->empty_packet == 0)
                                gspca_dev->empty_packet = 1;

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to