lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251205071918.1396810-1-xiaolei.wang@windriver.com>
Date: Fri,  5 Dec 2025 15:19:18 +0800
From: Xiaolei Wang <xiaolei.wang@...driver.com>
To: sakari.ailus@...ux.intel.com, dave.stevenson@...pberrypi.com,
        jacopo@...ndi.org, mchehab@...nel.org,
        prabhakar.mahadev-lad.rj@...renesas.com,
        laurent.pinchart@...asonboard.com, hverkuil+cisco@...nel.org,
        xiaolei.wang@...driver.com
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] media: i2c: ov5647: use our own mutex for the ctrl lock

__v4l2_ctrl_handler_setup() and __v4l2_ctrl_modify_range()
contains an assertion to verify that the v4l2_ctrl_handler::lock
is held, as it should only be called when the lock has already
been acquired. Therefore use our own mutex for the ctrl lock,
otherwise a warning will be  reported.

Fixes: 4974c2f19fd8 ("media: ov5647: Support gain, exposure and AWB controls")
Cc: stable@...r.kernel.org
Signed-off-by: Xiaolei Wang <xiaolei.wang@...driver.com>
---

v1: https://patchwork.kernel.org/project/linux-media/patch/20251201000026.690298-1-xiaolei.wang@windriver.com/
v2: Compared to v1, directly using sensor->ctrls avoids introducing unnecessary variables and adds a fix tag to address the initial issue.

 drivers/media/i2c/ov5647.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index e193fef4fced..e5404aa744a3 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -1291,6 +1291,8 @@ static int ov5647_init_controls(struct ov5647 *sensor)
 
 	v4l2_ctrl_handler_init(&sensor->ctrls, 9);
 
+	sensor->ctrls.lock = &sensor->lock;
+
 	v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
 			  V4L2_CID_AUTOGAIN, 0, 1, 1, 0);
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ