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

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

Merge "power: qcom: msm-core: Add mutex lock for ioctl"

parents f4885b0b 24cfbaf1
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -409,9 +409,10 @@ static int update_userspace_power(struct sched_params __user *argp)
	if (!sp)
	if (!sp)
		return -ENOMEM;
		return -ENOMEM;



	mutex_lock(&policy_update_mutex);
	sp->power = allocate_2d_array_uint32_t(node->sp->num_of_freqs);
	sp->power = allocate_2d_array_uint32_t(node->sp->num_of_freqs);
	if (IS_ERR_OR_NULL(sp->power)) {
	if (IS_ERR_OR_NULL(sp->power)) {
		mutex_unlock(&policy_update_mutex);
		ret = PTR_ERR(sp->power);
		ret = PTR_ERR(sp->power);
		kfree(sp);
		kfree(sp);
		return ret;
		return ret;
@@ -455,6 +456,7 @@ static int update_userspace_power(struct sched_params __user *argp)
		}
		}
	}
	}
	spin_unlock(&update_lock);
	spin_unlock(&update_lock);
	mutex_unlock(&policy_update_mutex);


	for_each_possible_cpu(cpu) {
	for_each_possible_cpu(cpu) {
		if (!pdata_valid[cpu])
		if (!pdata_valid[cpu])
@@ -468,6 +470,7 @@ static int update_userspace_power(struct sched_params __user *argp)
	return 0;
	return 0;


failed:
failed:
	mutex_unlock(&policy_update_mutex);
	for (i = 0; i < TEMP_DATA_POINTS; i++)
	for (i = 0; i < TEMP_DATA_POINTS; i++)
		kfree(sp->power[i]);
		kfree(sp->power[i]);
	kfree(sp->power);
	kfree(sp->power);