From patchwork Sat Oct 17 06:39:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 54497 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9H6eS64011789 for ; Sat, 17 Oct 2009 06:40:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751365AbZJQGjl (ORCPT ); Sat, 17 Oct 2009 02:39:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751379AbZJQGjk (ORCPT ); Sat, 17 Oct 2009 02:39:40 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:36128 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301AbZJQGjj (ORCPT ); Sat, 17 Oct 2009 02:39:39 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id 601BA19BB97; Sat, 17 Oct 2009 08:39:43 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04435-14; Sat, 17 Oct 2009 08:39:42 +0200 (CEST) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw2.diku.dk (Postfix) with ESMTP id 06C6119BB8D; Sat, 17 Oct 2009 08:39:42 +0200 (CEST) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 493BD6DF823; Sat, 17 Oct 2009 08:37:07 +0200 (CEST) Received: by ask.diku.dk (Postfix, from userid 3767) id E0AA9F9B2; Sat, 17 Oct 2009 08:39:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id D5CB4F810; Sat, 17 Oct 2009 08:39:41 +0200 (CEST) Date: Sat, 17 Oct 2009 08:39:41 +0200 (CEST) From: Julia Lawall To: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 6/14] drivers/media/video: Move dereference after NULL test Message-ID: MIME-Version: 1.0 X-Virus-Scanned: amavisd-new at diku.dk Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/video/usbvideo/quickcam_messenger.c b/drivers/media/video/usbvideo/quickcam_messenger.c index 803d3e4..f0043d0 100644 --- a/drivers/media/video/usbvideo/quickcam_messenger.c +++ b/drivers/media/video/usbvideo/quickcam_messenger.c @@ -692,12 +692,13 @@ static int qcm_start_data(struct uvd *uvd) static void qcm_stop_data(struct uvd *uvd) { - struct qcm *cam = (struct qcm *) uvd->user_data; + struct qcm *cam; int i, j; int ret; if ((uvd == NULL) || (!uvd->streaming) || (uvd->dev == NULL)) return; + cam = (struct qcm *) uvd->user_data; ret = qcm_camera_off(uvd); if (ret) diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c index c015da8..7500411 100644 --- a/drivers/media/video/davinci/vpif_display.c +++ b/drivers/media/video/davinci/vpif_display.c @@ -383,8 +383,6 @@ static int vpif_get_std_info(struct channel_obj *ch) int index; std_info->stdid = vid_ch->stdid; - if (!std_info) - return -1; for (index = 0; index < ARRAY_SIZE(ch_params); index++) { config = &ch_params[index]; diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index d48c450..d3bd82a 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c @@ -1011,8 +1011,6 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip) unsigned int idx; int err, addr; - if (snd_BUG_ON(!chip)) - return -EINVAL; strcpy(card->mixername, "SAA7134 Mixer"); for (idx = 0; idx < ARRAY_SIZE(snd_saa7134_volume_controls); idx++) {