summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Hsu <jasonchhsu@google.com>2020-07-16 14:41:57 +0800
committerJason Hsu <jasonchhsu@google.com>2020-07-16 14:41:57 +0800
commit87efbb8f4dc7025c059c39ac3d1474ebf333d9f0 (patch)
tree3ffc2569da9f1c59bfb2d08c614b1b3d17aa9d22
parent7aec69f85d5e5f0a60230b2573cf8de2c8808f4e (diff)
downloadmsm-extra-android-msm-bramble-4.19-android11-d1.tar.gz
During negative test case if the backend index is out of range update error check to avoid crashes. Bug: 159417423 Signed-off-by: Jason Hsu <jasonchhsu@google.com> Change-Id: Ieb31efc8553e1a6b21751a73adcc259efa7b0863
-rw-r--r--asoc/msm-pcm-routing-v2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/asoc/msm-pcm-routing-v2.c b/asoc/msm-pcm-routing-v2.c
index c57a37b5..1ff5da5a 100644
--- a/asoc/msm-pcm-routing-v2.c
+++ b/asoc/msm-pcm-routing-v2.c
@@ -30389,7 +30389,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;
}