[PATCH 04/11] media: i2c: ov5640: fix error path in ov5640_set_mode
From: Kieran Bingham
Date: Fri May 01 2026 - 11:40:24 EST
During ov5640_set_mode if the call to set the pclk fails, we should
correctly restore the state of the auto exposure
and auto gain if they were modified on entry into the function.
Signed-off-by: Kieran Bingham <kieran.bingham@xxxxxxxxxxxxxxxx>
---
drivers/media/i2c/ov5640.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
index 0dc4f4272d05..244c341d0e77 100644
--- a/drivers/media/i2c/ov5640.c
+++ b/drivers/media/i2c/ov5640.c
@@ -2349,7 +2349,7 @@ static int ov5640_set_mode(struct ov5640_dev *sensor)
else
ret = ov5640_set_dvp_pclk(sensor);
if (ret < 0)
- return 0;
+ goto restore_auto_exp_gain;
if ((dn_mode == SUBSAMPLING && orig_dn_mode == SCALING) ||
(dn_mode == SCALING && orig_dn_mode == SUBSAMPLING)) {
--
2.52.0