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

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

Merge "msm: camera: fix untrusted pointer for power down setting"

parents 2b4e720a b66ddad9
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -426,17 +426,11 @@ static int32_t msm_sensor_create_pd_settings(void *setting,

#ifdef CONFIG_COMPAT
	if (is_compat_task()) {
		int i = 0;
		struct msm_sensor_power_setting32 *power_setting_iter =
		(struct msm_sensor_power_setting32 *)compat_ptr((
		(struct msm_camera_sensor_slave_info32 *)setting)->
		power_setting_array.power_setting);

		for (i = 0; i < size_down; i++) {
			pd[i].config_val = power_setting_iter[i].config_val;
			pd[i].delay = power_setting_iter[i].delay;
			pd[i].seq_type = power_setting_iter[i].seq_type;
			pd[i].seq_val = power_setting_iter[i].seq_val;
		rc = msm_sensor_get_pw_settings_compat(
			pd, pu, size_down);
		if (rc < 0) {
			pr_err("failed");
			return -EFAULT;
		}
	} else
#endif