Merge "msm: camera: add protection in the cci write function"

This commit is contained in:
Linux Build Service Account 2017-07-04 01:20:53 -07:00 committed by Gerrit - the friendly Code Review server
commit 01f0e05f48

View file

@ -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__);