From: Hans Verkuil Date: Fri, 28 Sep 2012 09:24:18 +0000 (-0300) Subject: [media] videobuf2-core: fill in length field for multiplanar buffers X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3c0b60618118745220bc0f9bf27e51e37367427c;p=linux-beck.git [media] videobuf2-core: fill in length field for multiplanar buffers length should be set to num_planes in __fill_v4l2_buffer(). That way the caller knows how many planes there are in the buffer. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 5a132b286894..432df119af27 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -348,6 +348,7 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b) * Fill in plane-related data if userspace provided an array * for it. The caller has already verified memory and size. */ + b->length = vb->num_planes; memcpy(b->m.planes, vb->v4l2_planes, b->length * sizeof(struct v4l2_plane)); } else {