提交 62bdbb73 编写于 作者: J Julia Lawall 提交者: Mauro Carvalho Chehab

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: NJulia Lawall <julia@diku.dk>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 f0289efa
...@@ -1417,11 +1417,6 @@ static enum fe_stv0900_error stv0900_init_internal(struct dvb_frontend *fe, ...@@ -1417,11 +1417,6 @@ static enum fe_stv0900_error stv0900_init_internal(struct dvb_frontend *fe,
return error; return error;
} }
if (state->internal == NULL) {
error = STV0900_INVALID_HANDLE;
return error;
}
intp = state->internal; intp = state->internal;
intp->demod_mode = p_init->demod_mode; intp->demod_mode = p_init->demod_mode;
......
...@@ -3737,9 +3737,6 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -3737,9 +3737,6 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma)
if (size > FRAME_NUM*CPIA_MAX_FRAME_SIZE) if (size > FRAME_NUM*CPIA_MAX_FRAME_SIZE)
return -EINVAL; return -EINVAL;
if (!cam || !cam->ops)
return -ENODEV;
/* make this _really_ smp-safe */ /* make this _really_ smp-safe */
if (mutex_lock_interruptible(&cam->busy_lock)) if (mutex_lock_interruptible(&cam->busy_lock))
return -EINTR; return -EINTR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册