diff options
author | Alexander Stein <alexander.stein@ew.tq-group.com> | 2023-03-21 08:27:07 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-04-11 18:11:53 +0200 |
commit | 6cf9e3572ee8aa4d8e847850cedf45e12ac94cfe (patch) | |
tree | 6c88f3b478bf8912891d718c86482d83b550ada9 /drivers/media | |
parent | e6f68b1c4048e97bb01b770fd9c487ecce6c5cab (diff) | |
download | lwn-6cf9e3572ee8aa4d8e847850cedf45e12ac94cfe.tar.gz lwn-6cf9e3572ee8aa4d8e847850cedf45e12ac94cfe.zip |
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: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/nxp/imx7-media-csi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c index af4a2df780e3..b701e823436a 100644 --- a/drivers/media/platform/nxp/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -1214,6 +1214,9 @@ static int imx7_csi_video_g_selection(struct file *file, void *fh, { struct imx7_csi *csi = video_drvdata(file); + if (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + return -EINVAL; + switch (s->target) { case V4L2_SEL_TGT_COMPOSE: case V4L2_SEL_TGT_COMPOSE_DEFAULT: |