提交 20058f90 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

[media] v4l2-subdev.c: add 'which' checks for enum ops

Return an error if an invalid 'which' valid is passed in.
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Acked-by: NLad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: NLad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 e1c47e73
......@@ -321,6 +321,10 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
case VIDIOC_SUBDEV_ENUM_MBUS_CODE: {
struct v4l2_subdev_mbus_code_enum *code = arg;
if (code->which != V4L2_SUBDEV_FORMAT_TRY &&
code->which != V4L2_SUBDEV_FORMAT_ACTIVE)
return -EINVAL;
if (code->pad >= sd->entity.num_pads)
return -EINVAL;
......@@ -331,6 +335,10 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
case VIDIOC_SUBDEV_ENUM_FRAME_SIZE: {
struct v4l2_subdev_frame_size_enum *fse = arg;
if (fse->which != V4L2_SUBDEV_FORMAT_TRY &&
fse->which != V4L2_SUBDEV_FORMAT_ACTIVE)
return -EINVAL;
if (fse->pad >= sd->entity.num_pads)
return -EINVAL;
......@@ -359,6 +367,10 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
case VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL: {
struct v4l2_subdev_frame_interval_enum *fie = arg;
if (fie->which != V4L2_SUBDEV_FORMAT_TRY &&
fie->which != V4L2_SUBDEV_FORMAT_ACTIVE)
return -EINVAL;
if (fie->pad >= sd->entity.num_pads)
return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册