]> err.no Git - linux-2.6/commit
V4L/DVB (6305): V4L: videobuf-core.c avoid NULL dereferences in videobuf-core
authorBrandon Philips <bphilips@suse.de>
Fri, 5 Oct 2007 19:26:27 +0000 (16:26 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 03:03:20 +0000 (00:03 -0300)
commit49ee718ef51f4d938f80f67207e1bfa2a38897a4
tree1f6079f64f6196e50cd9ed993fe1e3a2c8eb4331
parentc726b65d079cafabc558616badbeead442e2b114
V4L/DVB (6305): V4L: videobuf-core.c avoid NULL dereferences in videobuf-core

The return value of videobuf_alloc() is unchecked but this function will
return NULL on an error.  Check for NULL and make videobuf_reqbufs()
return the number of successfully allocated buffers.

Also, fix saa7146_video.c and bttv-driver.c to use this returned
buffer count.

Tested against the vivi driver.  Not tested against saa7146 or bt8xx
devices.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/common/saa7146_video.c
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/videobuf-core.c