From: Hans Verkuil <hverkuil@xs4all.nl>
To: linux-media@vger.kernel.org
Cc: pawel@osciak.com, s.nawrocki@samsung.com,
m.szyprowski@samsung.com, Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [RFCv1 PATCH 9/9] v4l2-ioctl: check CREATE_BUFS format via TRY_FMT.
Date: Tue, 04 Feb 2014 09:54:49 +0100 [thread overview]
Message-ID: <52F0AAD9.2010806@xs4all.nl> (raw)
In-Reply-To: <1391093491-23077-10-git-send-email-hverkuil@xs4all.nl>
On 01/30/2014 03:51 PM, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> The format passed to VIDIOC_CREATE_BUFS is completely unchecked at
> the moment. So pass it to VIDIOC_TRY_FMT first.
Don't bother reviewing this. I'm going to change this anyway.
Regards,
Hans
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
> drivers/media/v4l2-core/v4l2-ioctl.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 707aef7..7b9d59e 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1443,9 +1443,15 @@ static int v4l_dqbuf(const struct v4l2_ioctl_ops *ops,
> static int v4l_create_bufs(const struct v4l2_ioctl_ops *ops,
> struct file *file, void *fh, void *arg)
> {
> + struct video_device *vfd = video_devdata(file);
> struct v4l2_create_buffers *create = arg;
> int ret = check_fmt(file, create->format.type);
>
> + if (ret)
> + return ret;
> +
> + if (!WARN_ON(!is_valid_ioctl(vfd, VIDIOC_TRY_FMT)))
> + ret = v4l_try_fmt(ops, file, fh, &create->format);
> return ret ? ret : ops->vidioc_create_bufs(file, fh, create);
> }
>
>
prev parent reply other threads:[~2014-02-04 8:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-30 14:51 [RFCv1 PATCH 0/9] vb2: fixes, balancing callbacks Hans Verkuil
2014-01-30 14:51 ` [RFCv1 PATCH 1/9] vb2: add debugging code to check for unbalanced ops Hans Verkuil
2014-01-30 14:51 ` [RFCv1 PATCH 2/9] vb2: change result code of buf_finish to void Hans Verkuil
2014-01-30 14:51 ` [RFCv1 PATCH 3/9] vb2: add note that buf_finish can be called with !vb2_is_streaming() Hans Verkuil
2014-01-30 14:51 ` [RFCv1 PATCH 4/9] vb2: call buf_finish from __dqbuf Hans Verkuil
2014-01-30 14:51 ` [RFCv1 PATCH 5/9] vb2: fix buf_init/buf_cleanup call sequences Hans Verkuil
2014-01-30 14:51 ` [RFCv1 PATCH 6/9] vb2: fix read/write regression Hans Verkuil
2014-01-30 14:51 ` [RFCv1 PATCH 7/9] vb2: add reinit_streaming op Hans Verkuil
2014-02-04 8:56 ` Hans Verkuil
2014-01-30 14:51 ` [RFCv1 PATCH 8/9] vivi: add support for reinit_streaming Hans Verkuil
2014-01-30 14:51 ` [RFCv1 PATCH 9/9] v4l2-ioctl: check CREATE_BUFS format via TRY_FMT Hans Verkuil
2014-02-04 8:54 ` Hans Verkuil [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=52F0AAD9.2010806@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=pawel@osciak.com \
--cc=s.nawrocki@samsung.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