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

Commit 05261982 authored by Wei Ding's avatar Wei Ding
Browse files

msm: camera: add protection in the cci write function



Add state check before execute CCI function.

Change-Id: I1c876e4eac70316bfe322b11f807e367c020e7d0
Signed-off-by: default avatarWei Ding <weiding@codeaurora.org>
parent bc399a65
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1602,6 +1602,12 @@ static int32_t msm_cci_write(struct v4l2_subdev *sd,
		return rc;
	}

	if (cci_dev->cci_state != CCI_STATE_ENABLED) {
		pr_err("%s invalid cci state %d\n",
			__func__, cci_dev->cci_state);
		return -EINVAL;
	}

	if (c_ctrl->cci_info->cci_i2c_master >= MASTER_MAX
			|| c_ctrl->cci_info->cci_i2c_master < 0) {
		pr_err("%s:%d Invalid I2C master addr\n", __func__, __LINE__);