瀏覽代碼

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

qctecmdr 5 年之前
父節點
當前提交
e1757aef95
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      asoc/msm-pcm-routing-v2.c

+ 5 - 1
asoc/msm-pcm-routing-v2.c

@@ -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;
 }