Commit 44b22d45 authored by Benjamin Mugnier's avatar Benjamin Mugnier Committed by Mauro Carvalho Chehab

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: default avatarBenjamin Mugnier <benjamin.mugnier@foss.st.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 985ed1d7
...@@ -1870,11 +1870,11 @@ static int vgxy61_probe(struct i2c_client *client) ...@@ -1870,11 +1870,11 @@ static int vgxy61_probe(struct i2c_client *client)
vgxy61_fill_framefmt(sensor, sensor->current_mode, &sensor->fmt, vgxy61_fill_framefmt(sensor, sensor->current_mode, &sensor->fmt,
VGXY61_MEDIA_BUS_FMT_DEF); VGXY61_MEDIA_BUS_FMT_DEF);
mutex_init(&sensor->lock);
ret = vgxy61_update_hdr(sensor, sensor->hdr); ret = vgxy61_update_hdr(sensor, sensor->hdr);
if (ret) if (ret)
return ret; goto error_power_off;
mutex_init(&sensor->lock);
ret = vgxy61_init_controls(sensor); ret = vgxy61_init_controls(sensor);
if (ret) { if (ret) {
...@@ -1913,8 +1913,8 @@ static int vgxy61_probe(struct i2c_client *client) ...@@ -1913,8 +1913,8 @@ static int vgxy61_probe(struct i2c_client *client)
media_entity_cleanup(&sensor->sd.entity); media_entity_cleanup(&sensor->sd.entity);
error_handler_free: error_handler_free:
v4l2_ctrl_handler_free(sensor->sd.ctrl_handler); v4l2_ctrl_handler_free(sensor->sd.ctrl_handler);
mutex_destroy(&sensor->lock);
error_power_off: error_power_off:
mutex_destroy(&sensor->lock);
vgxy61_power_off(dev); vgxy61_power_off(dev);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment