public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/13] go7007: don't use vb before test if it is not NULL
@ 2015-04-28 23:04 Mauro Carvalho Chehab
  2015-04-28 23:04 ` [PATCH 02/13] benq: fix indentation Mauro Carvalho Chehab
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Mauro Carvalho Chehab @ 2015-04-28 23:04 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Hans Verkuil

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>

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)
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-04-30  6:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 01/13] go7007: don't use vb before test if it is not NULL Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox