Commit 6b1dce25 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a8f35ce3
...@@ -1163,10 +1163,8 @@ int cx25821_vidioc_s_input(struct file *file, void *priv, unsigned int i) ...@@ -1163,10 +1163,8 @@ int cx25821_vidioc_s_input(struct file *file, void *priv, unsigned int i)
return err; return err;
} }
if (i >= CX25821_NR_INPUT) { if (i >= CX25821_NR_INPUT || INPUT(i)->type == 0)
dprintk(1, "%s(): -EINVAL\n", __func__);
return -EINVAL; return -EINVAL;
}
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
cx25821_video_mux(dev, i); cx25821_video_mux(dev, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment