[media] cx25821: s_input didn't check for invalid input

The s_input implementation allowed input 1 even if that didn't exist.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Hans Verkuil 2013-04-13 07:39:19 -03:00 committed by Mauro Carvalho Chehab
parent a8f35ce3d6
commit 6b1dce251f
1 changed files with 1 additions and 3 deletions

View File

@ -1163,10 +1163,8 @@ int cx25821_vidioc_s_input(struct file *file, void *priv, unsigned int i)
return err;
}
if (i >= CX25821_NR_INPUT) {
dprintk(1, "%s(): -EINVAL\n", __func__);
if (i >= CX25821_NR_INPUT || INPUT(i)->type == 0)
return -EINVAL;
}
mutex_lock(&dev->lock);
cx25821_video_mux(dev, i);