diff --git a/drivers/media/platform/bcm2835/bcm2835-unicam.c b/drivers/media/platform/bcm2835/bcm2835-unicam.c index 20b46a9e04c37631b3f0f7ad67f169c35fde450c..de288f87ff2f011675b12e4285567f877ec2e62f 100644 --- a/drivers/media/platform/bcm2835/bcm2835-unicam.c +++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c @@ -1885,6 +1885,9 @@ static int unicam_s_selection(struct file *file, void *priv, .r = sel->r, }; + if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + return -EINVAL; + return v4l2_subdev_call(dev->sensor, pad, set_selection, NULL, &sdsel); } @@ -1899,6 +1902,9 @@ static int unicam_g_selection(struct file *file, void *priv, }; int ret; + if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + return -EINVAL; + ret = v4l2_subdev_call(dev->sensor, pad, get_selection, NULL, &sdsel); if (!ret) sel->r = sdsel.r;