Message ID | 20210305031942.5648-1-baijiaju1990@gmail.com |
---|---|
State | Accepted |
Commit | 9a4619ef6cc1182ba02d9d465903d47a12bdc55a |
Headers | show |
Series | media: i2c: imx274: fix error return code of imx274_s_frame_interval() | expand |
diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c index 54642d5f2d5b..04f516cb6b07 100644 --- a/drivers/media/i2c/imx274.c +++ b/drivers/media/i2c/imx274.c @@ -1380,7 +1380,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;
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 <oslab@tsinghua.edu.cn> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> --- drivers/media/i2c/imx274.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)