linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf@free.fr>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] [media] gspca: passing wrong length parameter to reg_w()
Date: Wed, 2 May 2012 08:47:58 +0200	[thread overview]
Message-ID: <20120502084758.1a08823f@tele> (raw)
In-Reply-To: <20120502061525.GC28894@elgon.mountain>

On Wed, 2 May 2012 09:15:25 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> This looks like a cut an paste error.  This is a two byte array but we
> use 8 as a length parameter.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is a static checker fix.  I don't own the hardware.
> 
> diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c
> index ea17b5d..f39fee0 100644
> --- a/drivers/media/video/gspca/conex.c
> +++ b/drivers/media/video/gspca/conex.c
> @@ -306,7 +306,7 @@ static void cx_sensor(struct gspca_dev*gspca_dev)
>  
>  	reg_w(gspca_dev, 0x0020, reg20, 8);
>  	reg_w(gspca_dev, 0x0028, reg28, 8);
> -	reg_w(gspca_dev, 0x0010, reg10, 8);
> +	reg_w(gspca_dev, 0x0010, reg10, 2);
>  	reg_w_val(gspca_dev, 0x0092, 0x03);
>  
>  	switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
> @@ -326,7 +326,7 @@ static void cx_sensor(struct gspca_dev*gspca_dev)
>  	}
>  	reg_w(gspca_dev, 0x007b, reg7b, 6);
>  	reg_w_val(gspca_dev, 0x00f8, 0x00);
> -	reg_w(gspca_dev, 0x0010, reg10, 8);
> +	reg_w(gspca_dev, 0x0010, reg10, 2);
>  	reg_w_val(gspca_dev, 0x0098, 0x41);
>  	for (i = 0; i < 11; i++) {
>  		if (i == 3 || i == 5 || i == 8)

Hi Dan,

Thanks for the patch. The bug is very very old (6 years, at least -
neither have I such a webcam).

Maybe the fix could have been

	reg_w(gspca_dev, 0x0010, reg10, sizeof reg10);

but it is OK for me.

Acked-by: Jean-Francois Moine <http://moinejf.free.fr>

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

  reply	other threads:[~2012-05-02  6:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02  6:15 [patch] [media] gspca: passing wrong length parameter to reg_w() Dan Carpenter
2012-05-02  6:47 ` Jean-Francois Moine [this message]
2012-05-02  7:05   ` Dan Carpenter

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=20120502084758.1a08823f@tele \
    --to=moinejf@free.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@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;
as well as URLs for NNTP newsgroup(s).