From patchwork Tue Dec 22 21:00:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 69332 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBML0i9f031661 for ; Tue, 22 Dec 2009 21:00:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754503AbZLVVAN (ORCPT ); Tue, 22 Dec 2009 16:00:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752533AbZLVVAM (ORCPT ); Tue, 22 Dec 2009 16:00:12 -0500 Received: from mgw1.diku.dk ([130.225.96.91]:44276 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730AbZLVVAJ (ORCPT ); Tue, 22 Dec 2009 16:00:09 -0500 Received: from localhost (localhost [127.0.0.1]) by mgw1.diku.dk (Postfix) with ESMTP id 9813D52C325; Tue, 22 Dec 2009 22:00:08 +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 VirsRIviFEGR; Tue, 22 Dec 2009 22:00:07 +0100 (CET) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw1.diku.dk (Postfix) with ESMTP id 6E46252C30F; Tue, 22 Dec 2009 22:00:07 +0100 (CET) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id C15606DF84F; Tue, 22 Dec 2009 21:56:03 +0100 (CET) Received: by ask.diku.dk (Postfix, from userid 3767) id 54CBC49CE; Tue, 22 Dec 2009 22:00:07 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id 4B39F4632; Tue, 22 Dec 2009 22:00:07 +0100 (CET) Date: Tue, 22 Dec 2009 22:00:07 +0100 (CET) From: Julia Lawall To: mchehab@infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] drivers/media/dvb: Move a dereference below a NULL test Message-ID: MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff -u -p a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c --- a/drivers/media/dvb/dvb-usb/dw2102.c +++ b/drivers/media/dvb/dvb-usb/dw2102.c @@ -470,12 +470,13 @@ static int s6x0_i2c_transfer(struct i2c_ int num) { struct dvb_usb_device *d = i2c_get_adapdata(adap); - struct usb_device *udev = d->udev; + struct usb_device *udev; int ret = 0; int len, i, j; if (!d) return -ENODEV; + udev = d->udev; if (mutex_lock_interruptible(&d->i2c_mutex) < 0) return -EAGAIN;