Selaa lähdekoodia

V4L/DVB (6265): Prevent for calling mmap_free without an allocated buffer

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
Mauro Carvalho Chehab 17 vuotta sitten
vanhempi
commit
cd4765efdd
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      drivers/media/video/videobuf-core.c

+ 3 - 0
drivers/media/video/videobuf-core.c

@@ -880,6 +880,9 @@ int videobuf_mmap_free(struct videobuf_queue *q)
 	int i;
 	int i;
 	int rc;
 	int rc;
 
 
+	if (!q)
+		return 0;
+
 	MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
 	MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
 
 
 	rc  = CALL(q,mmap_free,q);
 	rc  = CALL(q,mmap_free,q);