aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/videobuf-dma-sg.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-21 15:06:09 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-21 15:06:09 +0200
commite66d90fb4abd0a27ee96f57a32fb561221c4d6ae (patch)
tree3337cba94c7444b06fdb0e8b487287d07b71f4a0 /drivers/media/video/videobuf-dma-sg.c
parent55ca089e2579de90f048aca2a3030b8b2f864813 (diff)
parent14b395e35d1afdd8019d11b92e28041fad591b71 (diff)
Merge branch 'linus' into xen-64bit
Diffstat (limited to 'drivers/media/video/videobuf-dma-sg.c')
-rw-r--r--drivers/media/video/videobuf-dma-sg.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c
index 03a7b946bd5..bc6d5aba0fe 100644
--- a/drivers/media/video/videobuf-dma-sg.c
+++ b/drivers/media/video/videobuf-dma-sg.c
@@ -1,7 +1,7 @@
/*
* helper functions for SG DMA video4linux capture buffers
*
- * The functions expect the hardware being able to scatter gatter
+ * The functions expect the hardware being able to scatter gather
* (i.e. the buffers are not linear in physical memory, but fragmented
* into PAGE_SIZE chunks). They also assume the driver does not need
* to touch the video data.
@@ -80,17 +80,15 @@ struct scatterlist*
videobuf_pages_to_sg(struct page **pages, int nr_pages, int offset)
{
struct scatterlist *sglist;
- int i = 0;
+ int i;
if (NULL == pages[0])
return NULL;
- sglist = kcalloc(nr_pages, sizeof(*sglist), GFP_KERNEL);
+ sglist = kmalloc(nr_pages * sizeof(*sglist), GFP_KERNEL);
if (NULL == sglist)
return NULL;
sg_init_table(sglist, nr_pages);
- if (NULL == pages[0])
- goto nopage;
if (PageHighMem(pages[0]))
/* DMA to highmem pages might not work */
goto highmem;