Skip to contentSkip to conversation

media: i2c: imx274: fix error return code of imx274_s_frame_interval()

PATCH New Jia-Ju Bai 1 participant 1 message Mar 5, 2021

Subsystems (3)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/media/i2c/imx274.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/i2c/imx274.c +2 -1
index 54642d5f2d5b..04f516cb6b07 100644
@@ -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;
Signature · 1 line
2.17.1