summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-07-26 23:34:32 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-07-26 23:34:32 -0700
commit92a41a2846e75083e9078cebd69ef3a7b75a5ad3 (patch)
tree7d950faac9a5fb725e14338908c12998abe7adc7 /drivers/misc
parent57fdba1a12fa9d850ef6546a2e22b8b409f8b85c (diff)
parent5feda7e4585af321fa766906dc506ef9aaa9568a (diff)
Merge "ASoc: msm: fix out of bounds array access"
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/qcom/qdsp6v2/q6audio_v2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/misc/qcom/qdsp6v2/q6audio_v2.c b/drivers/misc/qcom/qdsp6v2/q6audio_v2.c
index 7eb6629b1e57..51ba23da1270 100644
--- a/drivers/misc/qcom/qdsp6v2/q6audio_v2.c
+++ b/drivers/misc/qcom/qdsp6v2/q6audio_v2.c
@@ -85,6 +85,13 @@ void audio_in_get_dsp_frames(void *priv,
pr_debug("%s:session id %d: enc_framesotal_size=0x%8x\n", __func__,
audio->ac->session, payload[4]);
+ /* Ensure the index is within max array size: FRAME_NUM */
+ if (index >= FRAME_NUM) {
+ pr_err("%s: Invalid index %d\n",
+ __func__, index);
+ return;
+ }
+
audio->out_frame_info[index][0] = payload[9];
audio->out_frame_info[index][1] = payload[5];