diff options
author | Julia Lawall <julia@diku.dk> | 2009-12-22 16:00:07 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:33 -0500 |
commit | 21ead03bdde189106e0625baac170385a6c360af (patch) | |
tree | aefff28613a8a6a19dae836482b190a4aa9cc04b /drivers/media/dvb/dvb-usb/dw2102.c | |
parent | ed0ee8e1fbab49b494ef2994be92e7832dd6673c (diff) |
V4L/DVB (13949): Move a dereference below a NULL test
If the NULL test is necessary, then the dereference should be moved below
the NULL test.
The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@
- T i = E->fld;
+ T i;
... when != E
when != i
if (E == NULL) S
+ i = E->fld;
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dw2102.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dw2102.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c index 83a35524a82a..accc65509b07 100644 --- 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_adapter *adap, struct i2c_msg msg[], | |||
470 | int num) | 470 | int num) |
471 | { | 471 | { |
472 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 472 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
473 | struct usb_device *udev = d->udev; | 473 | struct usb_device *udev; |
474 | int ret = 0; | 474 | int ret = 0; |
475 | int len, i, j; | 475 | int len, i, j; |
476 | 476 | ||
477 | if (!d) | 477 | if (!d) |
478 | return -ENODEV; | 478 | return -ENODEV; |
479 | udev = d->udev; | ||
479 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) | 480 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) |
480 | return -EAGAIN; | 481 | return -EAGAIN; |
481 | 482 | ||