mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Walls <awalls@radix.net>
To: Dan Carpenter <error27@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	ivtv-devel@ivtvdriver.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ivtv: sizeof() => ARRAY_SIZE()
Date: Thu, 18 Mar 2010 07:37:22 -0400	[thread overview]
Message-ID: <1268912242.3084.7.camel@palomino.walls.org> (raw)
In-Reply-To: <20100317151156.GG5331@bicker>

On Wed, 2010-03-17 at 18:11 +0300, Dan Carpenter wrote:
> This fixes a smatch warning:
> drivers/media/video/ivtv/ivtv-vbi.c +138 ivtv_write_vbi(43) 
> 	error: buffer overflow 'vi->cc_payload' 256 <= 1023
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Looks good.

Reviewed-by: Andy Walls <awalls@radix.net>

And, if needed

Signed-off-by: Andy Walls <awalls@radix.net>

Regards,
Andy

> diff --git a/drivers/media/video/ivtv/ivtv-vbi.c b/drivers/media/video/ivtv/ivtv-vbi.c
> index f420d31..d73af45 100644
> --- a/drivers/media/video/ivtv/ivtv-vbi.c
> +++ b/drivers/media/video/ivtv/ivtv-vbi.c
> @@ -134,7 +134,7 @@ void ivtv_write_vbi(struct ivtv *itv, const struct v4l2_sliced_vbi_data *sliced,
>  			}
>  		}
>  	}
> -	if (found_cc && vi->cc_payload_idx < sizeof(vi->cc_payload)) {
> +	if (found_cc && vi->cc_payload_idx < ARRAY_SIZE(vi->cc_payload)) {
>  		vi->cc_payload[vi->cc_payload_idx++] = cc;
>  		set_bit(IVTV_F_I_UPDATE_CC, &itv->i_flags);
>  	}
> 


      reply	other threads:[~2010-03-18 11:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 15:11 Dan Carpenter
2010-03-18 11:37 ` Andy Walls [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=1268912242.3084.7.camel@palomino.walls.org \
    --to=awalls@radix.net \
    --cc=error27@gmail.com \
    --cc=ivtv-devel@ivtvdriver.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /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

all inboxes | Powered by JetHome®