public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitri Belimov <d.belimov@gmail.com>
To: Jarod Wilson <jarod@redhat.com>
Cc: linux-media@vger.kernel.org, Dan Carpenter <error27@gmail.com>,
	devel@driverdev.osuosl.org
Subject: Re: [PATCH v2] tm6000: fix vbuf may be used uninitialized
Date: Fri, 15 Apr 2011 12:04:01 +1000	[thread overview]
Message-ID: <20110415120401.61742c82@glory.local> (raw)
In-Reply-To: <1302634103-9328-1-git-send-email-jarod@redhat.com>

Hi

I think it's good.
No regression, all works well.

With my best regards, Dmitry.

> In commit 8aff8ba95155df, most of the manipulations to vbuf inside
> copy_streams were gated on if !dev->radio, but one place that touches
> vbuf lays outside those gates -- a memcpy of vbuf isn't NULL. If we
> initialize vbuf to NULL, that memcpy will never happen in the case
> where we do have dev->radio, and otherwise, in the !dev->radio case,
> the code behaves exactly like it did prior to 8aff8ba95155df.
> 
> While we're at it, also fix an incorrectly indented closing brace for
> one of the sections touching vbuf that is conditional on !dev->radio.
> 
> v2: add a detailed commit log and fix that brace
> 
> CC: Dan Carpenter <error27@gmail.com>
> CC: Dmitri Belimov <d.belimov@gmail.com>
> CC: devel@driverdev.osuosl.org
> Signed-off-by: Jarod Wilson <jarod@redhat.com>
> ---
>  drivers/staging/tm6000/tm6000-video.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/tm6000/tm6000-video.c
> b/drivers/staging/tm6000/tm6000-video.c index c80a316..8b971a0 100644
> --- a/drivers/staging/tm6000/tm6000-video.c
> +++ b/drivers/staging/tm6000/tm6000-video.c
> @@ -228,7 +228,7 @@ static int copy_streams(u8 *data, unsigned long
> len, unsigned long header = 0;
>  	int rc = 0;
>  	unsigned int cmd, cpysize, pktsize, size, field, block,
> line, pos = 0;
> -	struct tm6000_buffer *vbuf;
> +	struct tm6000_buffer *vbuf = NULL;
>  	char *voutp = NULL;
>  	unsigned int linewidth;
>  
> @@ -318,7 +318,7 @@ static int copy_streams(u8 *data, unsigned long
> len, if (pos + size > vbuf->vb.size)
>  						cmd =
> TM6000_URB_MSG_ERR; dev->isoc_ctl.vfield = field;
> -			}
> +				}
>  				break;
>  			case TM6000_URB_MSG_VBI:
>  				break;
> -- 
> 1.7.1
> 

      reply	other threads:[~2011-04-15  3:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 20:07 [PATCH] tm6000: fix vbuf may be used uninitialized Jarod Wilson
2011-03-24 20:31 ` Dan Carpenter
2011-03-24 22:05   ` Jarod Wilson
2011-04-11 21:48     ` Jarod Wilson
2011-04-12 18:48 ` [PATCH v2] " Jarod Wilson
2011-04-15  2:04   ` Dmitri Belimov [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=20110415120401.61742c82@glory.local \
    --to=d.belimov@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=error27@gmail.com \
    --cc=jarod@redhat.com \
    --cc=linux-media@vger.kernel.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