From edb804f93fd68c190d3c43e606f31c806343d647 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 3 Jun 2009 02:01:04 +0000 Subject: buf-core.c: add pointer check From: Figo.zhang 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 Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/videobuf-core.c | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/drivers/media/video') diff --git a/linux/drivers/media/video/videobuf-core.c b/linux/drivers/media/video/videobuf-core.c index e9696385d..faf912403 100644 --- a/linux/drivers/media/video/videobuf-core.c +++ b/linux/drivers/media/video/videobuf-core.c @@ -119,6 +119,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; -- cgit v1.2.3