Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/lineage-20.0' into TDA
Browse files Browse the repository at this point in the history
Change-Id: I47ffc94be2897daa4703c2bba01f40e2255f3cdd
Signed-off-by: Nanhumly <[email protected]>
  • Loading branch information
Nanhumly committed Sep 21, 2023
2 parents 556b233 + 69ea976 commit 540e160
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions sound/soc/msm/qdsp6v2/msm-pcm-host-voice-v2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
Expand Down Expand Up @@ -644,6 +645,12 @@ static int hpcm_start_vocpcm(char *pcm_id, struct hpcm_drv *prtd,
}
}

if (*no_of_tp != no_of_tp_req && *no_of_tp > 2) {
pr_err("%s:: Invalid hpcm start request\n", __func__);
memset(&prtd->start_cmd, 0, sizeof(struct start_cmd));
return -EINVAL;
}

if ((prtd->mixer_conf.tx.enable || prtd->mixer_conf.rx.enable) &&
*no_of_tp == no_of_tp_req) {
voc_send_cvp_start_vocpcm(voc_get_session_id(sess_name),
Expand Down
5 changes: 5 additions & 0 deletions sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,11 @@ static void msm_pcm_routing_process_voice(u16 reg, u16 val, int set)

session_id = msm_pcm_routing_get_voc_sessionid(val);

if (!session_id) {
pr_err("%s: Invalid session_id %x\n", __func__, session_id);
return;
}

pr_debug("%s: FE DAI 0x%x session_id 0x%x\n",
__func__, val, session_id);

Expand Down
3 changes: 2 additions & 1 deletion sound/soc/msm/qdsp6v2/q6core.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
Expand Down Expand Up @@ -87,7 +88,7 @@ static struct generic_get_data_ *generic_get_data;
static int parse_fwk_version_info(uint32_t *payload, uint16_t payload_size)
{
size_t ver_size;
int num_services;
uint16_t num_services;

pr_debug("%s: Payload info num services %d\n",
__func__, payload[4]);
Expand Down
7 changes: 7 additions & 0 deletions sound/soc/msm/qdsp6v2/q6voice.c
Original file line number Diff line number Diff line change
Expand Up @@ -2545,6 +2545,13 @@ static int voice_send_cvs_register_cal_cmd(struct voice_data *v)
goto unlock;
}

if (col_data->cal_data.size > MAX_COL_INFO_SIZE) {
pr_err("%s: Invalid cal data size %zu!\n",
__func__, col_data->cal_data.size);
ret = -EINVAL;
goto unlock;
}

memcpy(&cvs_reg_cal_cmd.cvs_cal_data.column_info[0],
(void *) &((struct audio_cal_info_voc_col *)
col_data->cal_info)->data,
Expand Down

0 comments on commit 540e160

Please sign in to comment.