]> Pileus Git - ~andy/linux/blobdiff - drivers/media/v4l2-core/videobuf2-dma-contig.c
Merge tag 'for-3.8-rc1' of git://gitorious.org/linux-pwm/linux-pwm
[~andy/linux] / drivers / media / v4l2-core / videobuf2-dma-contig.c
index 27de1bb731db0a537d09a76c88c03fd7df7a5d04..10beaee7f0ae592ae88803d7720d298a20beac0d 100644 (file)
@@ -162,6 +162,9 @@ static void *vb2_dc_alloc(void *alloc_ctx, unsigned long size)
        if (!buf)
                return ERR_PTR(-ENOMEM);
 
+       /* align image size to PAGE_SIZE */
+       size = PAGE_ALIGN(size);
+
        buf->vaddr = dma_alloc_coherent(dev, size, &buf->dma_addr, GFP_KERNEL);
        if (!buf->vaddr) {
                dev_err(dev, "dma_alloc_coherent of size %ld failed\n", size);