All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: imx-jpeg: propagate encoder command errors
@ 2026-10-12 14:18 Avi Weiss
  2026-10-12 18:59 ` Frank Li
  2026-10-13  2:01 ` [EXT] " Ming Qian
  0 siblings, 2 replies; 4+ messages in thread
From: Avi Weiss @ 2026-10-12 14:18 UTC (permalink / raw)
  To: Mirela Rabulea, linux-media
  Cc: Ming Qian, Hans Verkuil, Mauro Carvalho Chehab, imx, Avi Weiss

mxc_jpeg_encoder_cmd() returns success when
v4l2_m2m_ioctl_encoder_cmd() fails. When an encoder command is issued
while the mem2mem context is draining, the helper returns -EBUSY,
but userspace sees success.

Return the helper error, as mxc_jpeg_decoder_cmd() already does.
No obvious reason to clobber the error here.

Fixes: 4911c5acf935 ("media: imx-jpeg: Implement drain using v4l2-mem2mem helpers")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
 drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
index e17085935435..5e466ea65a92 100644
--- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
+++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
@@ -1726,7 +1726,7 @@ static int mxc_jpeg_encoder_cmd(struct file *file, void *priv,
 	ret = v4l2_m2m_ioctl_encoder_cmd(file, fh, cmd);
 	spin_unlock_irqrestore(&ctx->mxc_jpeg->hw_lock, flags);
 	if (ret < 0)
-		return 0;
+		return ret;
 
 	if (cmd->cmd == V4L2_ENC_CMD_STOP &&
 	    v4l2_m2m_has_stopped(fh->m2m_ctx))

base-commit: d7e7bca7169873b46e857c025c10f3336c1258d8
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-13 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 14:18 [PATCH] media: imx-jpeg: propagate encoder command errors Avi Weiss
2026-10-12 18:59 ` Frank Li
2026-10-13  2:01 ` [EXT] " Ming Qian
2026-10-13 14:47   ` Frank Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.