diff mbox

[5/8,media] gspca: Fix a warning for using len before filling it

Message ID 20101227142245.6db00c9a@gaivota (mailing list archive)
State Accepted
Headers show

Commit Message

Mauro Carvalho Chehab Dec. 27, 2010, 4:22 p.m. UTC
None
diff mbox

Patch

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;