diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2016-12-02 09:02:25 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-12-02 09:02:24 -0800 |
commit | 89b2746b6f0a739c1c267f8f75941eb6781681bd (patch) | |
tree | 93fb9db4140428854e476710a3451887b4e52014 /sound | |
parent | 4016e041b2bea388b55bd57aa794debe49d05b6f (diff) | |
parent | 581402534074b6aa9dcbb7ca1337c405664ad1a6 (diff) |
Merge "SoC: msm: q6dspv2: add null check for payload"
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/msm/qdsp6v2/q6asm.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/msm/qdsp6v2/q6asm.c b/sound/soc/msm/qdsp6v2/q6asm.c index f24f1f0f2453..38c51eb32f4d 100644 --- a/sound/soc/msm/qdsp6v2/q6asm.c +++ b/sound/soc/msm/qdsp6v2/q6asm.c @@ -1639,7 +1639,7 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv) asm_token.token = data->token; if (q6asm_get_flag_from_token(&asm_token, ASM_CMD_NO_WAIT_OFFSET)) { pr_debug("%s: No wait command opcode[0x%x] cmd_opcode:%x\n", - __func__, data->opcode, payload[0]); + __func__, data->opcode, payload ? payload[0] : 0); wakeup_flag = 0; } @@ -1673,9 +1673,14 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv) data->dest_port); if ((data->opcode != ASM_DATA_EVENT_RENDERED_EOS) && (data->opcode != ASM_DATA_EVENT_EOS) && - (data->opcode != ASM_SESSION_EVENT_RX_UNDERFLOW)) + (data->opcode != ASM_SESSION_EVENT_RX_UNDERFLOW)) { + if (payload == NULL) { + pr_err("%s: payload is null\n", __func__); + return -EINVAL; + } dev_vdbg(ac->dev, "%s: Payload = [0x%x] status[0x%x] opcode 0x%x\n", __func__, payload[0], payload[1], data->opcode); + } if (data->opcode == APR_BASIC_RSP_RESULT) { switch (payload[0]) { case ASM_STREAM_CMD_SET_PP_PARAMS_V2: |