All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: Axel Lin <axel.lin@ingics.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH] [media] s5c73m3: Fix off-by-one valid range checking for fie->index
Date: Tue, 30 Apr 2013 10:46:18 +0200	[thread overview]
Message-ID: <517F84DA.50503@samsung.com> (raw)
In-Reply-To: <1367296936.5772.2.camel@phoenix>

Hi Axel,

Thanks for the fix.


On 30.04.2013 06:42, Axel Lin wrote:
> Current code uses fie->index as array subscript, thus the valid value range
> is 0 ... ARRAY_SIZE(s5c73m3_intervals) - 1.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
>   drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
> index b353c50..cd365bb 100644
> --- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
> +++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
> @@ -956,7 +956,7 @@ static int s5c73m3_oif_enum_frame_interval(struct v4l2_subdev *sd,
>   
>   	if (fie->pad != OIF_SOURCE_PAD)
>   		return -EINVAL;
> -	if (fie->index > ARRAY_SIZE(s5c73m3_intervals))
> +	if (fie->index >= ARRAY_SIZE(s5c73m3_intervals))
>   		return -EINVAL;
>   
>   	mutex_lock(&state->lock);


      reply	other threads:[~2013-04-30  8:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30  4:42 [PATCH] [media] s5c73m3: Fix off-by-one valid range checking for fie->index Axel Lin
2013-04-30  8:46 ` Andrzej Hajda [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=517F84DA.50503@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=axel.lin@ingics.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.