atomisp/imx: Fix locking bug on error path

This was reported by Dan Carpenter. When we error with an IMX 227 we don't release
the lock and the sensor would then hang.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alan Cox 2017-03-20 14:40:06 +00:00 • committed by Greg Kroah-Hartman
commit 9bc30b3a79

View file

@ -454,8 +454,10 @@ static int imx_set_exposure_gain(struct v4l2_subdev *sd, u16 coarse_itg,
if (dev->sensor_id == IMX227_ID) {
ret = imx_write_reg_array(client, imx_param_hold);
if (ret)
if (ret) {
mutex_unlock(&dev->input_lock);
return ret;
}
}
/* For imx175, setting gain must be delayed by one */