Skip to content

Commit

Permalink
media: Revert "media: videobuf2: Fix length check for single plane dm…
Browse files Browse the repository at this point in the history
…abuf queueing"

commit 95e9295 upstream.

The updated length check for dmabuf types broke existing usage in v4l2
userland clients.

Fixes: 961d3b2 ("media: videobuf2: Fix length check for single plane dmabuf queueing")
Cc: stable@vger.kernel.org
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
naushir authored and gregkh committed Jan 30, 2021
1 parent 0fa0a05 commit 94fb5ff
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/media/common/videobuf2/videobuf2-v4l2.c
Expand Up @@ -118,8 +118,7 @@ static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b)
return -EINVAL;
}
} else {
length = (b->memory == VB2_MEMORY_USERPTR ||
b->memory == VB2_MEMORY_DMABUF)
length = (b->memory == VB2_MEMORY_USERPTR)
? b->length : vb->planes[0].length;

if (b->bytesused > length)
Expand Down

0 comments on commit 94fb5ff

Please sign in to comment.