From: Philipp Zabel Date: Wed, 6 Apr 2022 08:53:51 +0000 (+0100) Subject: media: coda: jpeg: set buffer error flag when header parsing fails X-Git-Tag: howlett/maple/20220722_2~486^2~212 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d2cc715a56df87a9422740d2d62fbf8f5ea4a33b;p=users%2Fjedix%2Flinux-maple.git media: coda: jpeg: set buffer error flag when header parsing fails If decoding fails because the output buffer does not contain a valid header, set the error flag on the returned capture buffer. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/chips-media/coda-jpeg.c b/drivers/media/platform/chips-media/coda-jpeg.c index 6b19efcd7fd5..dcb0bd662105 100644 --- a/drivers/media/platform/chips-media/coda-jpeg.c +++ b/drivers/media/platform/chips-media/coda-jpeg.c @@ -1355,7 +1355,7 @@ static int coda9_jpeg_prepare_decode(struct coda_ctx *ctx) src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx); dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE); - v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_DONE); + v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_ERROR); return ret; }