mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
ASoC: msm: qdsp6v2: add range check for audio port index
Add range check to make sure the received audio port index from ADSP is within the valid range. Change-Id: Ief647df1659f7f349a843f666d8f92f34a9a43be Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
This commit is contained in:
parent
0177bc3f55
commit
a219fb4db3
1 changed files with 7 additions and 0 deletions
|
@ -1429,6 +1429,13 @@ static int32_t q6asm_srvc_callback(struct apr_client_data *data, void *priv)
|
|||
}
|
||||
|
||||
dir = (data->token & 0x0F);
|
||||
if (dir != IN && dir != OUT) {
|
||||
pr_err("%s: Invalid audio port index: %d\n", __func__, dir);
|
||||
if ((sid > 0 && sid <= SESSION_MAX))
|
||||
spin_unlock_irqrestore(
|
||||
&(session[sid].session_lock), flags);
|
||||
return 0;
|
||||
}
|
||||
port = &ac->port[dir];
|
||||
|
||||
switch (data->opcode) {
|
||||
|
|
Loading…
Reference in a new issue