diff mbox

drivers/media/dvb: Move a dereference below a NULL test

Message ID Pine.LNX.4.64.0912222159480.28669@ask.diku.dk (mailing list archive)
State Accepted
Headers show

Commit Message

Julia Lawall Dec. 22, 2009, 9 p.m. UTC
None
diff mbox

Patch

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;