Skip to content

Commit

Permalink
media: i2c: imx274: fix error return code of imx274_s_frame_interval()
Browse files Browse the repository at this point in the history
When __v4l2_ctrl_modify_range() fails, no error return code of
imx274_s_frame_interval() is assigned.
To fix this bug, ret is assigned with the return valye of
__v4l2_ctrl_modify_range(), and then ret is checked.

Reported-by: TOTE Robot <[email protected]>
Signed-off-by: Jia-Ju Bai <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
XidianGeneral authored and mchehab committed Apr 6, 2021
1 parent a7de6ea commit 9a4619e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/i2c/imx274.c
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,8 @@ static int imx274_s_frame_interval(struct v4l2_subdev *sd,
max = fi->interval.numerator * 1000000
/ fi->interval.denominator;
def = max;
if (__v4l2_ctrl_modify_range(ctrl, min, max, 1, def)) {
ret = __v4l2_ctrl_modify_range(ctrl, min, max, 1, def);
if (ret) {
dev_err(&imx274->client->dev,
"Exposure ctrl range update failed\n");
goto unlock;
Expand Down

0 comments on commit 9a4619e

Please sign in to comment.