linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Zhaowei Yuan <zhaowei.yuan@samsung.com>, jtp.park@samsung.com
Cc: linux-media@vger.kernel.org, k.debski@samsung.com,
	m.chehab@samsung.com, kyungmin.park@samsung.com,
	linux-samsung-soc@vger.kernel.org, hverkuil@xs4all.nl
Subject: Re: [PATCH] videobuf2-core: make checking condition more strict
Date: Wed, 20 Aug 2014 11:26:14 +0200	[thread overview]
Message-ID: <53F469B6.8050403@samsung.com> (raw)
In-Reply-To: <1408504315-3114-1-git-send-email-zhaowei.yuan@samsung.com>

On 20/08/14 05:11, Zhaowei Yuan wrote:
> It's also invalid that plane_no equals to vb->num_planes

The patch looks good to me but I would make the summary line more 
specific, e.g. "vb2: fix plane index sanity check in vb2_plane_cookie()".

I think this patch should be backported to the stable trees.

> Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
> ---
>  drivers/media/v4l2-core/videobuf2-core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
> index c359006..1ae4e57 100644
> --- a/drivers/media/v4l2-core/videobuf2-core.c
> +++ b/drivers/media/v4l2-core/videobuf2-core.c
> @@ -1130,7 +1130,7 @@ EXPORT_SYMBOL_GPL(vb2_plane_vaddr);
>   */
>  void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned int plane_no)
>  {
> -	if (plane_no > vb->num_planes || !vb->planes[plane_no].mem_priv)
> +	if (plane_no >= vb->num_planes || !vb->planes[plane_no].mem_priv)
>  		return NULL;
> 
>  	return call_ptr_memop(vb, cookie, vb->planes[plane_no].mem_priv);
> --
> 1.7.9.5

-- 
Regards,
Sylwester

      reply	other threads:[~2014-08-20  9:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20  3:11 [PATCH] videobuf2-core: make checking condition more strict Zhaowei Yuan
2014-08-20  9:26 ` 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=53F469B6.8050403@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jtp.park@samsung.com \
    --cc=k.debski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=zhaowei.yuan@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;
as well as URLs for NNTP newsgroup(s).