diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-09-08 20:01:33 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-09-08 20:01:32 -0700 |
| commit | f51db1aa4a19c0044b30f66381c47acad1974526 (patch) | |
| tree | 0a6b7e492686a88165687bd93ac78f114e620d85 | |
| parent | e8ed26ab139b13feafea18828684c509c6e97907 (diff) | |
| parent | 81b7a0a0e08c1a7f7099c6887d0bb06018b65a2b (diff) | |
Merge "ASoC: msm: qdsp6v2: check if index is out of range before use"
| -rw-r--r-- | sound/soc/msm/qdsp6v2/q6afe.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/msm/qdsp6v2/q6afe.c b/sound/soc/msm/qdsp6v2/q6afe.c index 538a8baa8268..f6a687611f8a 100644 --- a/sound/soc/msm/qdsp6v2/q6afe.c +++ b/sound/soc/msm/qdsp6v2/q6afe.c @@ -5597,6 +5597,12 @@ int afe_get_sp_th_vi_ftm_data(struct afe_sp_th_vi_get_param *th_vi) goto done; } index = q6audio_get_port_index(port); + if (index < 0) { + pr_err("%s: invalid port 0x%x, index %d\n", + __func__, port, index); + ret = -EINVAL; + goto done; + } th_vi->hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); th_vi->hdr.pkt_size = sizeof(*th_vi); |
