From 6fec0645c783ea4dd693e57c4f25300e0bd4781a Mon Sep 17 00:00:00 2001 From: Lakshman Chaluvaraju Date: Fri, 21 Jan 2022 13:41:34 +0530 Subject: asoc: changes to fix KW errors Add changes to fix KW errors. Change-Id: I87fc8bf5b2753cef6af881713637e9521389708d Signed-off-by: Lakshman Chaluvaraju --- 4.0/asoc/msm-pcm-routing-v2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/4.0/asoc/msm-pcm-routing-v2.c b/4.0/asoc/msm-pcm-routing-v2.c index a690c7c9..5ba11ea3 100644 --- a/4.0/asoc/msm-pcm-routing-v2.c +++ b/4.0/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 @@ -1657,6 +1658,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; -- cgit v1.2.3