diff mbox

[v2] videobuf_dma_sg: a new implementation for mmap

Message ID 1280322504.13781.7.camel@localhost.localdomain (mailing list archive)
State Rejected
Headers show

Commit Message

Figo.zhang July 28, 2010, 1:08 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/videobuf-dma-sg.c
b/drivers/media/video/videobuf-dma-sg.c
index 8359e6b..767483d 100644
--- a/drivers/media/video/videobuf-dma-sg.c
+++ b/drivers/media/video/videobuf-dma-sg.c
@@ -201,10 +201,11 @@  int videobuf_dma_init_kernel(struct
videobuf_dmabuf *dma, int direction,
 	dprintk(1, "init kernel [%d pages]\n", nr_pages);
 
 	dma->direction = direction;
-	dma->vmalloc = vmalloc_32(nr_pages << PAGE_SHIFT);
-	if (NULL == dma->vmalloc) {
-		dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages);
-		return -ENOMEM;
+	if (!dma->vmalloc)
+		dma->vmalloc = vmalloc_32(nr_pages << PAGE_SHIFT);
+		if (NULL == dma->vmalloc) {
+			dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages);
+			return -ENOMEM;
 	}