public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]videobuf-core.c: add pointer check
@ 2009-06-03  2:01 Figo.zhang
  2009-06-05  2:13 ` figo.zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Figo.zhang @ 2009-06-03  2:01 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media, Hans Verkuil, Trent Piepho

add poiter check for videobuf_queue_core_init().

any guys who write a v4l driver, pass a NULL pointer or a non-inintial
pointer to the first parameter such as videobuf_queue_sg_init() , it 
would be crashed.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
--- 
drivers/media/video/videobuf-core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c
index b7b0584..5f41fd9 100644
--- a/drivers/media/video/videobuf-core.c
+++ b/drivers/media/video/videobuf-core.c
@@ -118,6 +118,7 @@ void videobuf_queue_core_init(struct videobuf_queue *q,
 			 void *priv,
 			 struct videobuf_qtype_ops *int_ops)
 {
+	BUG_ON(!q);
 	memset(q, 0, sizeof(*q));
 	q->irqlock   = irqlock;
 	q->dev       = dev;



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

end of thread, other threads:[~2009-06-15 16:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1244337379.3355.1.camel@myhost>
2009-06-07  1:21 ` [PATCH]videobuf-core.c: add pointer check Figo.zhang
2009-06-15 16:04   ` Figo.zhang
2009-06-03  2:01 Figo.zhang
2009-06-05  2:13 ` figo.zhang

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