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

Commit a094c735 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: sensor: actuator: avoid accessing out of bound memory"

parents 9c763ea7 021cacf1
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -96,6 +96,11 @@ static void msm_actuator_parse_i2c_params(struct msm_actuator_ctrl_t *a_ctrl,
		return;
	}

	if (a_ctrl->i2c_reg_tbl == NULL) {
		pr_err("failed. i2c reg tabl is NULL");
		return;
	}

	size = a_ctrl->reg_tbl_size;
	write_arr = a_ctrl->reg_tbl;
	i2c_tbl = a_ctrl->i2c_reg_tbl;
@@ -1278,9 +1283,11 @@ static int32_t msm_actuator_set_param(struct msm_actuator_ctrl_t *a_ctrl,

	if (copy_from_user(&a_ctrl->region_params,
		(void *)set_info->af_tuning_params.region_params,
		a_ctrl->region_size * sizeof(struct region_params_t)))
		a_ctrl->region_size * sizeof(struct region_params_t))) {
		a_ctrl->total_steps = 0;
		pr_err("Error copying region_params\n");
		return -EFAULT;

	}
	if (a_ctrl->act_device_type == MSM_CAMERA_PLATFORM_DEVICE) {
		cci_client = a_ctrl->i2c_client.cci_client;
		cci_client->sid =