public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCH 01/13] go7007: don't use vb before test if it is not NULL
Date: Thu, 30 Apr 2015 08:22:36 +0200	[thread overview]
Message-ID: <5541CA2C.3060803@xs4all.nl> (raw)
In-Reply-To: <7a73d61faf3046af216692dbf1473bafc645ed9f.1430262253.git.mchehab@osg.samsung.com>

On 04/29/2015 01:04 AM, Mauro Carvalho Chehab wrote:
> As reported by smatch:
> 	drivers/media/usb/go7007/go7007-driver.c:452 frame_boundary() warn: variable dereferenced before check 'vb' (see line 449)
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

> 
> diff --git a/drivers/media/usb/go7007/go7007-driver.c b/drivers/media/usb/go7007/go7007-driver.c
> index 95cffb771a62..0ab81ec8897a 100644
> --- a/drivers/media/usb/go7007/go7007-driver.c
> +++ b/drivers/media/usb/go7007/go7007-driver.c
> @@ -446,7 +446,7 @@ static void go7007_motion_regions(struct go7007 *go, struct go7007_buffer *vb)
>   */
>  static struct go7007_buffer *frame_boundary(struct go7007 *go, struct go7007_buffer *vb)
>  {
> -	u32 *bytesused = &vb->vb.v4l2_planes[0].bytesused;
> +	u32 *bytesused;
>  	struct go7007_buffer *vb_tmp = NULL;
>  
>  	if (vb == NULL) {
> @@ -458,6 +458,7 @@ static struct go7007_buffer *frame_boundary(struct go7007 *go, struct go7007_buf
>  		go->next_seq++;
>  		return vb;
>  	}
> +	bytesused = &vb->vb.v4l2_planes[0].bytesused;
>  
>  	vb->vb.v4l2_buf.sequence = go->next_seq++;
>  	if (vb->modet_active && *bytesused + 216 < GO7007_BUF_SIZE)
> 


      parent reply	other threads:[~2015-04-30  6:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 23:04 [PATCH 01/13] go7007: don't use vb before test if it is not NULL Mauro Carvalho Chehab
2015-04-28 23:04 ` [PATCH 02/13] benq: fix indentation Mauro Carvalho Chehab
2015-04-28 23:04 ` [PATCH 03/13] bcm3510: " Mauro Carvalho Chehab
2015-04-28 23:04 ` [PATCH 04/13] dib3000mc: Fix indentation Mauro Carvalho Chehab
2015-04-28 23:04 ` [PATCH 05/13] lgdt3306a: fix indentation Mauro Carvalho Chehab
2015-04-28 23:04 ` [PATCH 06/13] stv0288: " Mauro Carvalho Chehab
2015-04-28 23:04 ` [PATCH 07/13] s5h1420: fix a buffer overflow when checking userspace params Mauro Carvalho Chehab
2015-04-28 23:04 ` [PATCH 08/13] cx24116: " Mauro Carvalho Chehab
2015-04-30  6:22 ` Hans Verkuil [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=5541CA2C.3060803@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mchehab@osg.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