aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/lm3560.c
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-11-07 07:44:42 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-12-10 08:07:30 -0500
commiteed8c3eebce72fe4fc766f9a23e4324b04bd86cf (patch)
treec32fbe5b55dc3f8f9735e704c5e5b5e363a0637c /drivers/media/i2c/lm3560.c
parentfe9a2bd881d96b1491b283483d7346abb52111f9 (diff)
[media] media: i2c: lm3560: fix missing unlock on error in lm3560_set_ctrl()
Add the missing unlock before return from function lm3560_set_ctrl() in the error handling case. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/i2c/lm3560.c')
-rw-r--r--drivers/media/i2c/lm3560.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c
index ab5857d66f2d..e728d9fb08d1 100644
--- a/drivers/media/i2c/lm3560.c
+++ b/drivers/media/i2c/lm3560.c
@@ -219,15 +219,19 @@ static int lm3560_set_ctrl(struct v4l2_ctrl *ctrl, enum lm3560_led_id led_no)
219 break; 219 break;
220 220
221 case V4L2_CID_FLASH_STROBE: 221 case V4L2_CID_FLASH_STROBE:
222 if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH) 222 if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH) {
223 return -EBUSY; 223 rval = -EBUSY;
224 goto err_out;
225 }
224 flash->led_mode = V4L2_FLASH_LED_MODE_FLASH; 226 flash->led_mode = V4L2_FLASH_LED_MODE_FLASH;
225 rval = lm3560_mode_ctrl(flash); 227 rval = lm3560_mode_ctrl(flash);
226 break; 228 break;
227 229
228 case V4L2_CID_FLASH_STROBE_STOP: 230 case V4L2_CID_FLASH_STROBE_STOP:
229 if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH) 231 if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH) {
230 return -EBUSY; 232 rval = -EBUSY;
233 goto err_out;
234 }
231 flash->led_mode = V4L2_FLASH_LED_MODE_NONE; 235 flash->led_mode = V4L2_FLASH_LED_MODE_NONE;
232 rval = lm3560_mode_ctrl(flash); 236 rval = lm3560_mode_ctrl(flash);
233 break; 237 break;
@@ -247,8 +251,8 @@ static int lm3560_set_ctrl(struct v4l2_ctrl *ctrl, enum lm3560_led_id led_no)
247 break; 251 break;
248 } 252 }
249 253
250 mutex_unlock(&flash->lock);
251err_out: 254err_out:
255 mutex_unlock(&flash->lock);
252 return rval; 256 return rval;
253} 257}
254 258