From patchwork Fri Mar 12 09:15:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 85219 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2C9Ffkf024367 for ; Fri, 12 Mar 2010 09:15:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756938Ab0CLJPk (ORCPT ); Fri, 12 Mar 2010 04:15:40 -0500 Received: from mgw1.diku.dk ([130.225.96.91]:52935 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756908Ab0CLJPi (ORCPT ); Fri, 12 Mar 2010 04:15:38 -0500 Received: from localhost (localhost [127.0.0.1]) by mgw1.diku.dk (Postfix) with ESMTP id 8FC9252C40B; Fri, 12 Mar 2010 10:15:36 +0100 (CET) X-Virus-Scanned: amavisd-new at diku.dk Received: from mgw1.diku.dk ([127.0.0.1]) by localhost (mgw1.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XNgEc7rsEuVj; Fri, 12 Mar 2010 10:15:32 +0100 (CET) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw1.diku.dk (Postfix) with ESMTP id 42FF552C32E; Fri, 12 Mar 2010 10:15:32 +0100 (CET) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 3485D6DFB5B; Fri, 12 Mar 2010 10:09:45 +0100 (CET) Received: by ask.diku.dk (Postfix, from userid 3767) id 1F993200B0; Fri, 12 Mar 2010 10:15:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id 17104200AC; Fri, 12 Mar 2010 10:15:32 +0100 (CET) Date: Fri, 12 Mar 2010 10:15:32 +0100 (CET) From: Julia Lawall To: "Karicheri, Muralidharan" Cc: "akpm@linux-foundation.org" , "mchehab@infradead.org" , "linux-media@vger.kernel.org" Subject: RE: [patch 2/5] drivers/media/video: move dereference after NULL test In-Reply-To: Message-ID: References: <201003112202.o2BM2HpB013125@imap1.linux-foundation.org> MIME-Version: 1.0 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 (demeter.kernel.org [140.211.167.41]); Fri, 12 Mar 2010 09:15:41 +0000 (UTC) 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/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++) { diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c index dfddef7..b2dce78 100644 --- a/drivers/media/video/davinci/vpif_display.c +++ b/drivers/media/video/davinci/vpif_display.c @@ -383,7 +383,7 @@ static int vpif_get_std_info(struct channel_obj *ch) int index; std_info->stdid = vid_ch->stdid; - if (!std_info) + if (!std_info->stdid) return -1; for (index = 0; index < ARRAY_SIZE(ch_params); index++) {