From f82b056a61d23639a739eff35dc218bbedb85970 Mon Sep 17 00:00:00 2001 From: Surendar karka Date: Fri, 10 Jul 2020 15:58:21 +0530 Subject: [PATCH] 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 --- asoc/msm-pcm-routing-v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asoc/msm-pcm-routing-v2.c b/asoc/msm-pcm-routing-v2.c index c397dc41753f..e95e17c7403c 100644 --- a/asoc/msm-pcm-routing-v2.c +++ b/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; }