Skip to content

Commit 2ea4ce0

Browse files
njhollinghurstpelwell
authored andcommitted
media: i2c: imx477: Fix uninitialized bug when restarting camera
In imx477_start_streaming, when restarting before the auto-suspend timeout (5s) so that the common register config write was skipped, "ret" was used uninitialized, leading to intermittent failure. (Since return values are fully checked after the common write, there is anyway no need to propagate ret to mode-specific write.) Signed-off-by: Nick Hollinghurst <[email protected]>
1 parent 12e23f2 commit 2ea4ce0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/i2c/imx477.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,8 +1599,8 @@ static int imx477_start_streaming(struct imx477 *imx477)
15991599

16001600
/* Apply default values of current mode */
16011601
reg_list = &imx477->mode->reg_list;
1602-
cci_multi_reg_write(imx477->regmap, reg_list->regs,
1603-
reg_list->num_of_regs, &ret);
1602+
ret = cci_multi_reg_write(imx477->regmap, reg_list->regs,
1603+
reg_list->num_of_regs, NULL);
16041604
if (ret) {
16051605
dev_err(&client->dev, "%s failed to set mode\n", __func__);
16061606
return ret;

0 commit comments

Comments
 (0)