From c0a2283f016f51355f47f84e6e2e44c633885f24 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Fri, 22 May 2020 20:42:11 +0000 Subject: [PATCH] fixup! media: rkvdec: Fix .buf_prepare --- drivers/staging/media/rkvdec/rkvdec.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c index 393d649a17757f..dd78e1c98ae089 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -508,13 +508,11 @@ static int rkvdec_buf_prepare(struct vb2_buffer *vb) } /* - * Buffer's bytesused is written by the driver for CAPTURE buffers, - * or if the application passed zero bytesused on an OUTPUT buffer. + * Buffer's bytesused is written by the driver for CAPTURE buffers. */ - if (!V4L2_TYPE_IS_OUTPUT(vq->type) || - (V4L2_TYPE_IS_OUTPUT(vq->type) && !vb2_get_plane_payload(vb, 0))) - vb2_set_plane_payload(vb, 0, - f->fmt.pix_mp.plane_fmt[0].sizeimage); + if (!V4L2_TYPE_IS_OUTPUT(vq->type)) + vb2_set_plane_payload(vb, 0, f->fmt.pix_mp.plane_fmt[0].sizeimage); + return 0; }