summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2017-03-20 14:40:06 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-21 08:04:32 +0100
commit9bc30b3a7951a2568817a8c8024e6bdc469e305e (patch)
treed8e442361b61120cfedf58f2c1d4ecc6ee8be680
parentb8340109400321d1ac23db0ad20a1d7bf17bff04 (diff)
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>
-rw-r--r--drivers/staging/media/atomisp/i2c/imx/imx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/media/atomisp/i2c/imx/imx.c b/drivers/staging/media/atomisp/i2c/imx/imx.c
index a73f90282c89..408a7b945153 100644
--- a/drivers/staging/media/atomisp/i2c/imx/imx.c
+++ b/drivers/staging/media/atomisp/i2c/imx/imx.c
@@ -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 */