[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210305031942.5648-1-baijiaju1990@gmail.com>
Date: Thu, 4 Mar 2021 19:19:42 -0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: leonl@...pardimaging.com, mchehab@...nel.org
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
Jia-Ju Bai <baijiaju1990@...il.com>
Subject: [PATCH] media: i2c: imx274: fix error return code of imx274_s_frame_interval()
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@...nghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
---
drivers/media/i2c/imx274.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
--
2.17.1
Powered by blists - more mailing lists