[media] media: vb2: add a check if queued userptr buffer is large enough

Videobuf2 accepted any userptr buffer without verifying if its size is
large enough to store the video data from the driver. The driver reports
the minimal size of video data once in queue_setup and expects that
videobuf2 provides buffers that match these requirements. This patch
adds the required check.

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Marek Szyprowski
2011-08-24 06:36:26 -03:00
committed by Mauro Carvalho Chehab
parent a6bd62be5a
commit c1426bc727
2 changed files with 25 additions and 17 deletions

View File

@@ -276,6 +276,7 @@ struct vb2_queue {
wait_queue_head_t done_wq;
void *alloc_ctx[VIDEO_MAX_PLANES];
unsigned long plane_sizes[VIDEO_MAX_PLANES];
unsigned int streaming:1;