From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 1/1] v4l: subdev: Check for pads in [gs]_frame_interval
Date: Fri, 01 Nov 2013 18:31:07 +0100 [thread overview]
Message-ID: <5273E55B.10103@gmail.com> (raw)
In-Reply-To: <1381997754-3348-1-git-send-email-sakari.ailus@linux.intel.com>
Hi Sakari,
On 10/17/2013 10:15 AM, Sakari Ailus wrote:
> The validity of the pad field in struct v4l2_subdev_frame_interval was not
> ensured by the V4L2 subdev IOCTL helper. Fix this.
>
> Signed-off-by: Sakari Ailus<sakari.ailus@linux.intel.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Regards,
Sylwester
> ---
> drivers/media/v4l2-core/v4l2-subdev.c | 16 ++++++++++++++--
> 1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> index 996c248..3fa1907 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -305,11 +305,23 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
> fse);
> }
>
> - case VIDIOC_SUBDEV_G_FRAME_INTERVAL:
> + case VIDIOC_SUBDEV_G_FRAME_INTERVAL: {
> + struct v4l2_subdev_frame_interval *fi = arg;
> +
> + if (fi->pad>= sd->entity.num_pads)
> + return -EINVAL;
> +
> return v4l2_subdev_call(sd, video, g_frame_interval, arg);
> + }
> +
> + case VIDIOC_SUBDEV_S_FRAME_INTERVAL: {
> + struct v4l2_subdev_frame_interval *fi = arg;
> +
> + if (fi->pad>= sd->entity.num_pads)
> + return -EINVAL;
>
> - case VIDIOC_SUBDEV_S_FRAME_INTERVAL:
> return v4l2_subdev_call(sd, video, s_frame_interval, arg);
> + }
>
> case VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL: {
> struct v4l2_subdev_frame_interval_enum *fie = arg;
prev parent reply other threads:[~2013-11-01 17:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-17 8:15 [PATCH 1/1] v4l: subdev: Check for pads in [gs]_frame_interval Sakari Ailus
2013-11-01 17:31 ` Sylwester Nawrocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5273E55B.10103@gmail.com \
--to=sylvester.nawrocki@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).