Commit dc77523c authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

[media] videobuf2-core: call __setup_offsets only for mmap memory type

__setup_offsets fills the v4l2_planes' mem_offset fields, which is only valid
for V4L2_MEMORY_MMAP type buffers. For V4L2_MEMORY_DMABUF and _USERPTR buffers,
this incorrectly overwrites the fd and userptr fields.
Reported-by: default avatarMichael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Acked-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Acked-by: default avatarPawel Osciak <pawel@osciak.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 8ca5d2d8
......@@ -241,7 +241,8 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum v4l2_memory memory,
q->bufs[q->num_buffers + buffer] = vb;
}
__setup_offsets(q, buffer);
if (memory == V4L2_MEMORY_MMAP)
__setup_offsets(q, buffer);
dprintk(1, "Allocated %d buffers, %d plane(s) each\n",
buffer, num_planes);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment