]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/media/video/videobuf-dma-sg.c
V4L/DVB (8252): buf-dma-sg.c: avoid clearing memory twice
[linux-beck.git] / drivers / media / video / videobuf-dma-sg.c
index 03a7b946bd5448b4b5e471836fd8469bdfc492c8..8ed60827d35088f76fa990017b9acf81e93df002 100644 (file)
@@ -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;