[PATCH 08/24] atomisp/imx: Fix locking bug on error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---
 drivers/staging/media/atomisp/i2c/imx/imx.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/imx/imx.c b/drivers/staging/media/atomisp/i2c/imx/imx.c
index a73f902..408a7b9 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 */




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux