Commit 6cf9e357 authored by Alexander Stein's avatar Alexander Stein Committed by Hans Verkuil

media: imx: imx7-media-csi: Fail on invalid type in VIDIOC_G_SELECTION

This device only supports video capture, so bail out if invalid
selection type is passed.
Signed-off-by: default avatarAlexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent e6f68b1c
...@@ -1214,6 +1214,9 @@ static int imx7_csi_video_g_selection(struct file *file, void *fh, ...@@ -1214,6 +1214,9 @@ static int imx7_csi_video_g_selection(struct file *file, void *fh,
{ {
struct imx7_csi *csi = video_drvdata(file); struct imx7_csi *csi = video_drvdata(file);
if (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
switch (s->target) { switch (s->target) {
case V4L2_SEL_TGT_COMPOSE: case V4L2_SEL_TGT_COMPOSE:
case V4L2_SEL_TGT_COMPOSE_DEFAULT: case V4L2_SEL_TGT_COMPOSE_DEFAULT:
......
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