Skip to content

Commit

Permalink
[media] cx25821: s_input didn't check for invalid input
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Apr 16, 2013
1 parent a8f35ce commit 6b1dce2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/media/pci/cx25821/cx25821-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6b1dce2

Please sign in to comment.