diff options
author | Julia Lawall <julia@diku.dk> | 2010-02-06 03:43:58 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:57 -0500 |
commit | 62bdbb735c0415c2ffdddc2269a860a76f7f716a (patch) | |
tree | 6f46610dcccc749ab3c08a09e6c74d64811c5935 /drivers/media/video/cpia.c | |
parent | f0289efa1938eac27a98883bf33af946b13e1110 (diff) |
V4L/DVB: drivers/media: Correct NULL test
In each case, the NULL test has been performed already.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r@
expression *x;
expression e;
identifier l;
@@
if (x == NULL || ...) {
... when forall
return ...; }
... when != goto l;
when != x = e
when != &x
*x == NULL
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cpia.c')
-rw-r--r-- | drivers/media/video/cpia.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index 551ddf216a4b..933ae4c8cb9a 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c | |||
@@ -3737,9 +3737,6 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma) | |||
3737 | if (size > FRAME_NUM*CPIA_MAX_FRAME_SIZE) | 3737 | if (size > FRAME_NUM*CPIA_MAX_FRAME_SIZE) |
3738 | return -EINVAL; | 3738 | return -EINVAL; |
3739 | 3739 | ||
3740 | if (!cam || !cam->ops) | ||
3741 | return -ENODEV; | ||
3742 | |||
3743 | /* make this _really_ smp-safe */ | 3740 | /* make this _really_ smp-safe */ |
3744 | if (mutex_lock_interruptible(&cam->busy_lock)) | 3741 | if (mutex_lock_interruptible(&cam->busy_lock)) |
3745 | return -EINTR; | 3742 | return -EINTR; |