]> git.ipfire.org Git - thirdparty/openwrt.git/blob
1e89992eba7bd0b4f4513911de95cbe8c59e9587
[thirdparty/openwrt.git] /
1 From 4204deb5423c20600dadaf6303f65ecade673760 Mon Sep 17 00:00:00 2001
2 From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
3 Date: Mon, 11 Sep 2023 12:17:25 +0300
4 Subject: [PATCH 0638/1085] media: i2c: imx477: Fix locking in
5 imx477_init_controls()
6
7 The driver does not lock the imx477 mutex when calling
8 imx477_set_framing_limits(), leading to:
9
10 WARNING: CPU: 3 PID: 426 at drivers/media/v4l2-core/v4l2-ctrls-api.c:934 __v4l2_ctrl_modify_range+0x1a0/0x210 [
11 videodev]
12
13 Fix this by taking the lock.
14
15 Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
16 ---
17 drivers/media/i2c/imx477.c | 4 ++++
18 1 file changed, 4 insertions(+)
19
20 --- a/drivers/media/i2c/imx477.c
21 +++ b/drivers/media/i2c/imx477.c
22 @@ -2069,9 +2069,13 @@ static int imx477_init_controls(struct i
23
24 imx477->sd.ctrl_handler = ctrl_hdlr;
25
26 + mutex_lock(&imx477->mutex);
27 +
28 /* Setup exposure and frame/line length limits. */
29 imx477_set_framing_limits(imx477);
30
31 + mutex_unlock(&imx477->mutex);
32 +
33 return 0;
34
35 error: