瀏覽代碼

asoc: update error check to avoid fix crash issues

During negative test case if the backend index is out of range
we will observe crash issues, update error check to avoid crashes.

Change-Id: I07531ee538013841f93acd02537ac5a7c1e350ba
Signed-off-by: Surendar karka <[email protected]>
Surendar karka 4 年之前
父節點
當前提交
f82b056a61
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      asoc/msm-pcm-routing-v2.c

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

@@ -30515,7 +30515,7 @@ static int msm_routing_put_pll_clk_drift(struct snd_kcontrol *kcontrol,
 	clk_drift = ucontrol->value.integer.value[1];
 	clk_reset = ucontrol->value.integer.value[2];
 
-	if (be_idx < 0 && be_idx >= MSM_BACKEND_DAI_MAX) {
+	if (be_idx < 0 || be_idx >= MSM_BACKEND_DAI_MAX) {
 		pr_err("%s: Invalid be id %d\n", __func__, be_idx);
 		return -EINVAL;
 	}