Skip to content

Commit

Permalink
media: i2c: imx477: Fix locking in imx477_init_controls()
Browse files Browse the repository at this point in the history
The driver does not lock the imx477 mutex when calling
imx477_set_framing_limits(), leading to:

WARNING: CPU: 3 PID: 426 at drivers/media/v4l2-core/v4l2-ctrls-api.c:934 __v4l2_ctrl_modify_range+0x1a0/0x210 [
videodev]

Fix this by taking the lock.

Signed-off-by: Tomi Valkeinen <[email protected]>
  • Loading branch information
tomba authored and pelwell committed Sep 28, 2023
1 parent c7cf339 commit 72c25bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/i2c/imx477.c
Original file line number Diff line number Diff line change
Expand Up @@ -2069,9 +2069,13 @@ static int imx477_init_controls(struct imx477 *imx477)

imx477->sd.ctrl_handler = ctrl_hdlr;

mutex_lock(&imx477->mutex);

/* Setup exposure and frame/line length limits. */
imx477_set_framing_limits(imx477);

mutex_unlock(&imx477->mutex);

return 0;

error:
Expand Down

0 comments on commit 72c25bb

Please sign in to comment.