Skip to content

Commit

Permalink
msm: sensor: Add mutex lock during ois power down operations
Browse files Browse the repository at this point in the history
Protecting operations performed during ois powerdown
from race condition by adding mutex locks.

CRs-Fixed: 2081806
Change-Id: I8a918dc306e639d50a896c8d77f8eb7a72fcb195
Signed-off-by: Rahul Sharma <sharah@codeaurora.org>
  • Loading branch information
Rahul Sharma authored and Gerrit - the friendly Code Review server committed Aug 28, 2017
1 parent 90076db commit d26a61f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/platform/msm/ais/sensor/ois/msm_ois.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,13 @@ static long msm_ois_subdev_ioctl(struct v4l2_subdev *sd,
pr_err("o_ctrl->i2c_client.i2c_func_tbl NULL\n");
return -EINVAL;
}
mutex_lock(o_ctrl->ois_mutex);
rc = msm_ois_power_down(o_ctrl);
if (rc < 0) {
pr_err("%s:%d OIS Power down failed\n",
__func__, __LINE__);
}
mutex_unlock(o_ctrl->ois_mutex);
return msm_ois_close(sd, NULL);
default:
return -ENOIOCTLCMD;
Expand Down

0 comments on commit d26a61f

Please sign in to comment.