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 1/4] media: zoran: remove always-false buffer size check
Date: Wed, 25 Nov 2026 16:05:45 +0900 [thread overview]
Message-ID: <20261125070548.28989-2-hiyoukou@gmail.com> (raw)
In-Reply-To: <20261125070548.28989-1-hiyoukou@gmail.com>
zoran_v4l_set_format() assigns zr->buffer_size and then immediately
compares the very same expression against it:
zr->buffer_size = height * width * bpp;
/* Check against available buffer size */
if (height * width * bpp > zr->buffer_size) {
The condition can never be true, so the check and its error path are
dead code.
The comparison used to be made against fh->buffers.buffer_size, the size
of the buffers that had already been allocated for the file handle,
which made it a real bounds check. The assignment on the line above
turned the right hand side into the value that had just been computed,
so nothing is verified any more.
Remove the dead check. No functional change.
Signed-off-by: Minseo Park <hiyoukou@gmail.com>
---
drivers/media/pci/zoran/zoran_driver.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
index 5b4d5dd06edb..a053365922c4 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -179,13 +179,6 @@ static int zoran_v4l_set_format(struct zoran *zr, int width, int height,
zr->buffer_size = height * width * bpp;
- /* Check against available buffer size */
- if (height * width * bpp > zr->buffer_size) {
- pci_dbg(zr->pci_dev, "%s - video buffer size (%d kB) is too small\n",
- __func__, zr->buffer_size >> 10);
- return -EINVAL;
- }
-
/* The video front end needs 4-byte alinged line sizes */
if ((bpp == 2 && (width & 1)) || (bpp == 3 && (width & 3))) {
--
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 ` Minseo Park [this message]
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 ` [PATCH 3/4] media: zoran: reject VIDIOC_S_FMT while the queue is busy Minseo Park
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-2-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®