From: Minseo Park <hiyoukou@gmail.com>
To: clabbe@baylibre.com, mchehab@kernel.org, hverkuil@kernel.org,
linux-media@vger.kernel.org
Cc: mjpeg-users@lists.sourceforge.net, linux-kernel@vger.kernel.org,
Minseo Park <hiyoukou@gmail.com>
Subject: [PATCH 3/4] media: zoran: reject VIDIOC_S_FMT while the queue is busy
Date: Wed, 25 Nov 2026 16:05:47 +0900 [thread overview]
Message-ID: <20261125070548.28989-4-hiyoukou@gmail.com> (raw)
In-Reply-To: <20261125070548.28989-1-hiyoukou@gmail.com>
zoran_s_fmt_vid_cap() updates zr->v4l_settings, zr->jpg_settings,
zr->map_mode and zr->buffer_size without checking whether the queue
already owns buffers, so the format can be changed underneath an
allocated or streaming queue. The size the queue was set up with and
the geometry the hardware is programmed with then describe a format the
queue no longer matches.
Return -EBUSY while the queue is busy, as VIDIOC_S_FMT is specified to
do.
Signed-off-by: Minseo Park <hiyoukou@gmail.com>
---
drivers/media/pci/zoran/zoran_driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
index 99fedac12b67..ec8ed5601f50 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -506,6 +506,9 @@ static int zoran_s_fmt_vid_cap(struct file *file, void *fh,
int i;
int res = 0;
+ if (vb2_is_busy(&zr->vq))
+ return -EBUSY;
+
if (fmt->fmt.pix.pixelformat == V4L2_PIX_FMT_MJPEG)
return zoran_s_fmt_vid_out(file, fh, fmt);
--
2.43.0
next prev parent reply other threads:[~2026-11-25 7:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 7:05 [PATCH 0/4] media: zoran: fix capture buffer size / geometry desync Minseo Park
2026-11-25 7:05 ` [PATCH 1/4] media: zoran: remove always-false buffer size check Minseo Park
2026-11-25 7:05 ` [PATCH 2/4] media: zoran: do not update device state before the format is validated Minseo Park
2026-11-25 7:05 ` Minseo Park [this message]
2026-11-25 7:05 ` [PATCH 4/4] media: zoran: add KUnit tests for capture format negotiation Minseo Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261125070548.28989-4-hiyoukou@gmail.com \
--to=hiyoukou@gmail.com \
--cc=clabbe@baylibre.com \
--cc=hverkuil@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=mjpeg-users@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®