From patchwork Mon Dec 27 16:22:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 434781 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBRKCVA2025997 for ; Mon, 27 Dec 2010 20:17:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754478Ab0L0Q0d (ORCPT ); Mon, 27 Dec 2010 11:26:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59047 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753780Ab0L0Q0d convert rfc822-to-8bit (ORCPT ); Mon, 27 Dec 2010 11:26:33 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBRGQXas027574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 27 Dec 2010 11:26:33 -0500 Received: from gaivota (vpn-11-243.rdu.redhat.com [10.11.11.243]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oBRGNDpF028091 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 27 Dec 2010 11:26:30 -0500 Date: Mon, 27 Dec 2010 14:22:45 -0200 From: Mauro Carvalho Chehab Cc: Linux Media Mailing List Subject: [PATCH 5/8] [media] gspca: Fix a warning for using len before filling it Message-ID: <20101227142245.6db00c9a@gaivota> In-Reply-To: References: Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Dec 2010 20:17:04 +0000 (UTC) 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;