summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnnLee <johnnlee@google.com>2022-03-25 10:25:52 +0800
committerJohnnLee <johnnlee@google.com>2022-03-25 10:25:52 +0800
commit8ba12fbc3f3c8ffe42bca10157e6c10485fd22d8 (patch)
tree6424cb2511b393753a5a10ad7a84dc8aef2d8d4f
parentc8b97c12e9bbb22a8abaeb3016e24e749bf02565 (diff)
parentad59b31b3cd15d9e2e07eadbdeaf63008792c57e (diff)
downloadmsm-extra-8ba12fbc3f3c8ffe42bca10157e6c10485fd22d8.tar.gz
Bug: 223958127 Signed-off-by: JohnnLee <johnnlee@google.com> Change-Id: I8f0ea5df66808aad098a2da633f62ede0d8cc792
-rw-r--r--asoc/msm-pcm-routing-v2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/asoc/msm-pcm-routing-v2.c b/asoc/msm-pcm-routing-v2.c
index d0ce8714..d01f3560 100644
--- a/asoc/msm-pcm-routing-v2.c
+++ b/asoc/msm-pcm-routing-v2.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/init.h>
@@ -1667,6 +1668,11 @@ static int msm_pcm_routing_channel_mixer_v2(int fe_id, bool perf_mode,
}
be_id = channel_mixer_v2[fe_id][sess_type].port_idx - 1;
+ if (be_id < 0 || be_id >= MSM_BACKEND_DAI_MAX) {
+ pr_err("%s: Received out of bounds be_id %d\n",
+ __func__, be_id);
+ return -EINVAL;
+ }
channel_mixer_v2[fe_id][sess_type].input_channels[0] =
channel_mixer_v2[fe_id][sess_type].input_channel;