Merge "msm: camera: Make use of mutex lock to avoid race condition"
This commit is contained in:
commit
e6cb8897ab
1 changed files with 5 additions and 1 deletions
|
@ -1057,14 +1057,18 @@ static int msm_fd_s_ctrl(struct file *file, void *fh, struct v4l2_control *a)
|
|||
a->value = ctx->format.size->work_size;
|
||||
break;
|
||||
case V4L2_CID_FD_WORK_MEMORY_FD:
|
||||
mutex_lock(&ctx->fd_device->recovery_lock);
|
||||
if (ctx->work_buf.fd != -1)
|
||||
msm_fd_hw_unmap_buffer(&ctx->work_buf);
|
||||
if (a->value >= 0) {
|
||||
ret = msm_fd_hw_map_buffer(&ctx->mem_pool,
|
||||
a->value, &ctx->work_buf);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
mutex_unlock(&ctx->fd_device->recovery_lock);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&ctx->fd_device->recovery_lock);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Add table
Reference in a new issue