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

Commit e1757aef authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: msm-routing: Add lock in lsm_app_type_cfg_control callbacks"

parents 747b3bd8 a4804c73
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -22625,6 +22625,7 @@ static int msm_routing_get_lsm_app_type_cfg_control(
				kcontrol->private_value)->shift;
	int i = 0, j = 0;
	mutex_lock(&routing_lock);
	ucontrol->value.integer.value[i] = num_app_cfg_types;
	for (j = 0; j < num_app_cfg_types; ++j) {
@@ -22638,6 +22639,7 @@ static int msm_routing_get_lsm_app_type_cfg_control(
			ucontrol->value.integer.value[++i] =
				lsm_app_type_cfg[j].num_out_channels;
	}
	mutex_unlock(&routing_lock);
	return 0;
}
@@ -22649,9 +22651,11 @@ static int msm_routing_put_lsm_app_type_cfg_control(
				kcontrol->private_value)->shift;
	int i = 0, j;
	mutex_lock(&routing_lock);
	if (ucontrol->value.integer.value[0] > MAX_APP_TYPES) {
		pr_err("%s: number of app types exceed the max supported\n",
			__func__);
		mutex_unlock(&routing_lock);
		return -EINVAL;
	}
@@ -22671,7 +22675,7 @@ static int msm_routing_put_lsm_app_type_cfg_control(
			lsm_app_type_cfg[j].num_out_channels =
				ucontrol->value.integer.value[i++];
	}
	mutex_unlock(&routing_lock);
	return 0;
}