[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 <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
CC: Pawel Osciak <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
Marek Szyprowski 2011-08-24 06:36:26 -03:00 • committed by Mauro Carvalho Chehab
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;