mirror of https://gitee.com/openkylin/linux.git
[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>
This commit is contained in:
parent
fe9a2bd881
commit
eed8c3eebc
|
@ -219,15 +219,19 @@ static int lm3560_set_ctrl(struct v4l2_ctrl *ctrl, enum lm3560_led_id led_no)
|
|||
break;
|
||||
|
||||
case V4L2_CID_FLASH_STROBE:
|
||||
if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH)
|
||||
return -EBUSY;
|
||||
if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH) {
|
||||
rval = -EBUSY;
|
||||
goto err_out;
|
||||
}
|
||||
flash->led_mode = V4L2_FLASH_LED_MODE_FLASH;
|
||||
rval = lm3560_mode_ctrl(flash);
|
||||
break;
|
||||
|
||||
case V4L2_CID_FLASH_STROBE_STOP:
|
||||
if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH)
|
||||
return -EBUSY;
|
||||
if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH) {
|
||||
rval = -EBUSY;
|
||||
goto err_out;
|
||||
}
|
||||
flash->led_mode = V4L2_FLASH_LED_MODE_NONE;
|
||||
rval = lm3560_mode_ctrl(flash);
|
||||
break;
|
||||
|
@ -247,8 +251,8 @@ static int lm3560_set_ctrl(struct v4l2_ctrl *ctrl, enum lm3560_led_id led_no)
|
|||
break;
|
||||
}
|
||||
|
||||
mutex_unlock(&flash->lock);
|
||||
err_out:
|
||||
mutex_unlock(&flash->lock);
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue