From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: linux-media@vger.kernel.org
Cc: Michael Riesch <michael.riesch@collabora.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Gerald Loacker <gerald.loacker@wolfvision.net>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [PATCH v2 4/5] media: i2c: imx415: Fix control handler initial count
Date: Fri, 10 Apr 2026 09:19:43 +0300 [thread overview]
Message-ID: <20260410061944.241480-5-eagle.alexander923@gmail.com> (raw)
In-Reply-To: <20260410061944.241480-1-eagle.alexander923@gmail.com>
Replace the initial control count of 10 with 9 + 2 to correctly
account for the two controls added by v4l2_ctrl_new_fwnode_properties()
(orientation and rotation).
The driver currently adds nine explicit controls plus up to two
fwnode-based controls, totalling 11. Using a value of 10 in
v4l2_ctrl_handler_init() may cause the control handler to run out
of preallocated storage, leading to memory corruption when the 11th
control is added.
Fixes: 14cd15e7a1e2 ("media: i2c: add imx415 cmos image sensor driver")
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
drivers/media/i2c/imx415.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/imx415.c b/drivers/media/i2c/imx415.c
index b305adec30ce..ec0239ccf5fc 100644
--- a/drivers/media/i2c/imx415.c
+++ b/drivers/media/i2c/imx415.c
@@ -897,7 +897,7 @@ static int imx415_ctrls_init(struct imx415 *sensor)
if (ret < 0)
return ret;
- v4l2_ctrl_handler_init(&sensor->ctrls, 10);
+ v4l2_ctrl_handler_init(&sensor->ctrls, 9 + 2);
for (i = 0; i < ARRAY_SIZE(link_freq_menu_items); ++i) {
if (lane_rate == link_freq_menu_items[i] * 2)
--
2.52.0
next prev parent reply other threads:[~2026-04-10 6:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 6:19 [PATCH v2 0/5] media: i2c: imx415: driver improvements and fixes Alexander Shiyan
2026-04-10 6:19 ` [PATCH v2 1/5] media: i2c: imx415: Add missing ADBIT1 register for 10/12-bit output Alexander Shiyan
2026-04-10 6:19 ` [PATCH v2 2/5] media: i2c: imx415: Add missing CSI-2 timing configurations for all lane rates Alexander Shiyan
2026-04-10 6:19 ` [PATCH v2 3/5] media: i2c: imx415: Add missing 4-lane CSI-2 timing configurations Alexander Shiyan
2026-04-10 6:19 ` Alexander Shiyan [this message]
2026-04-10 6:19 ` [PATCH v2 5/5] media: i2c: imx415: Cluster horizontal and vertical flip controls Alexander Shiyan
2026-04-17 12:23 ` [PATCH v2 0/5] media: i2c: imx415: driver improvements and fixes Michael Riesch
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=20260410061944.241480-5-eagle.alexander923@gmail.com \
--to=eagle.alexander923@gmail.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=gerald.loacker@wolfvision.net \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=michael.riesch@collabora.com \
--cc=sakari.ailus@linux.intel.com \
/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