summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-19 09:52:26 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-19 09:52:26 -0800
commit003f49db57eefafd2ffbd1cb4c00dda8592fa16b (patch)
tree9b52bc4d6d4b8fa372ee31e05f846a0eee5d534f
parent8494beab671a0980f67e00dd84d0c7029b740d95 (diff)
parentb66f442dd97c781e873e8f7b248e197f86fd2980 (diff)
Merge "ASoC: msm: qdsp6v2: Add range checking in msm_dai_q6_set_channel_map"
-rw-r--r--sound/soc/msm/qdsp6v2/msm-dai-q6-v2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/msm/qdsp6v2/msm-dai-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-dai-q6-v2.c
index 954db7943e48..7b292eef02f8 100644
--- a/sound/soc/msm/qdsp6v2/msm-dai-q6-v2.c
+++ b/sound/soc/msm/qdsp6v2/msm-dai-q6-v2.c
@@ -1901,6 +1901,11 @@ static int msm_dai_q6_set_channel_map(struct snd_soc_dai *dai,
pr_err("%s: rx slot not found\n", __func__);
return -EINVAL;
}
+ if (rx_num > AFE_PORT_MAX_AUDIO_CHAN_CNT) {
+ pr_err("%s: invalid rx num %d\n", __func__, rx_num);
+ return -EINVAL;
+ }
+
for (i = 0; i < rx_num; i++) {
dai_data->port_config.slim_sch.shared_ch_mapping[i] =
rx_slot[i];
@@ -1934,6 +1939,11 @@ static int msm_dai_q6_set_channel_map(struct snd_soc_dai *dai,
pr_err("%s: tx slot not found\n", __func__);
return -EINVAL;
}
+ if (tx_num > AFE_PORT_MAX_AUDIO_CHAN_CNT) {
+ pr_err("%s: invalid tx num %d\n", __func__, tx_num);
+ return -EINVAL;
+ }
+
for (i = 0; i < tx_num; i++) {
dai_data->port_config.slim_sch.shared_ch_mapping[i] =
tx_slot[i];