Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96ac875c authored by Sureshnaidu Laveti's avatar Sureshnaidu Laveti Committed by Gerrit - the friendly Code Review server
Browse files

msm: sensor: Adding mutex for actuator power down operations



Protecting operations performed during actuator powerdown
from race condition by adding mutex.
CRs-Fixed: 1071891

Change-Id: I7d6b2e8878788615c02678a4a28d31dca0ed6bca
Signed-off-by: default avatarSureshnaidu Laveti <lsuresh@codeaurora.org>
parent 216721b4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1559,11 +1559,13 @@ static long msm_actuator_subdev_ioctl(struct v4l2_subdev *sd,
			pr_err("a_ctrl->i2c_client.i2c_func_tbl NULL\n");
			return -EINVAL;
		}
		mutex_lock(a_ctrl->actuator_mutex);
		rc = msm_actuator_power_down(a_ctrl);
		if (rc < 0) {
			pr_err("%s:%d Actuator Power down failed\n",
					__func__, __LINE__);
		}
		mutex_unlock(a_ctrl->actuator_mutex);
		return msm_actuator_close(sd, NULL);
	default:
		return -ENOIOCTLCMD;