summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorBenjamin Mugnier <benjamin.mugnier@foss.st.com>2023-02-01 15:04:16 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-03-20 00:36:32 +0100
commit44b22d45cd45550a9930f5be4e25fc9001e6820b (patch)
tree7dea7099dbf8d595df09bdbf722ee84880484016 /drivers/media
parentmedia: i2c: st-vgxy61: Move 'detect' call to 'power_on' (diff)
downloadlinux-44b22d45cd45550a9930f5be4e25fc9001e6820b.tar.xz
linux-44b22d45cd45550a9930f5be4e25fc9001e6820b.zip
media: i2c: st-vgxy61: Fix control flow error on probe
In case of error 'update_hdr' now goes through 'power_off' instead of returning, effectively shutting down the sensor. Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/st-vgxy61.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c
index 60f7974fc3bf..76db976e054d 100644
--- a/drivers/media/i2c/st-vgxy61.c
+++ b/drivers/media/i2c/st-vgxy61.c
@@ -1870,11 +1870,11 @@ static int vgxy61_probe(struct i2c_client *client)
vgxy61_fill_framefmt(sensor, sensor->current_mode, &sensor->fmt,
VGXY61_MEDIA_BUS_FMT_DEF);
+ mutex_init(&sensor->lock);
+
ret = vgxy61_update_hdr(sensor, sensor->hdr);
if (ret)
- return ret;
-
- mutex_init(&sensor->lock);
+ goto error_power_off;
ret = vgxy61_init_controls(sensor);
if (ret) {
@@ -1913,8 +1913,8 @@ error_pm_runtime:
media_entity_cleanup(&sensor->sd.entity);
error_handler_free:
v4l2_ctrl_handler_free(sensor->sd.ctrl_handler);
- mutex_destroy(&sensor->lock);
error_power_off:
+ mutex_destroy(&sensor->lock);
vgxy61_power_off(dev);
return ret;