From c594848c181742c41a59366a72b70cea997446fd Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 25 Sep 2007 11:53:24 -0300 Subject: Prevent for calling mmap_free without an allocated buffer Signed-off-by: Mauro Carvalho Chehab http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981 Reviewed-by: Ricardo Cerqueira --- linux/drivers/media/video/videobuf-core.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/video/videobuf-core.c b/linux/drivers/media/video/videobuf-core.c index f5d700364..a446067fd 100644 --- a/linux/drivers/media/video/videobuf-core.c +++ b/linux/drivers/media/video/videobuf-core.c @@ -881,6 +881,9 @@ int videobuf_mmap_free(struct videobuf_queue *q) int i; int rc; + if (!q) + return 0; + MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS); rc = CALL(q,mmap_free,q); -- cgit v1.2.3