|
|
@@ -207,6 +207,10 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb)
|
|
|
for (plane = 0; plane < vb->num_planes; ++plane) {
|
|
|
unsigned long size = PAGE_ALIGN(vb->planes[plane].length);
|
|
|
|
|
|
+ /* Did it wrap around? */
|
|
|
+ if (size < vb->planes[plane].length)
|
|
|
+ goto free;
|
|
|
+
|
|
|
mem_priv = call_ptr_memop(vb, alloc,
|
|
|
q->alloc_devs[plane] ? : q->dev,
|
|
|
q->dma_attrs, size, q->dma_dir, q->gfp_flags);
|