mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
Merge f3b2f5980b9da91842ee4432bfa1090fdc3f2156 on remote branch
Change-Id: Idee62bf1b38b9c411c3ee717ebc3f9a1b65d48c8
This commit is contained in:
commit
315167b3e7
@ -1,5 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
|
||||||
|
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
@ -953,6 +954,14 @@ int msm_audio_effects_pbe_handler(struct audio_client *ac,
|
|||||||
goto invalid_config;
|
goto invalid_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((pbe->config.bandpass_filter_order > 3) ||
|
||||||
|
(pbe->config.bandpass_filter_order < 1)) {
|
||||||
|
pr_err("%s: Invalid BPF order\n",
|
||||||
|
__func__);
|
||||||
|
rc = -EINVAL;
|
||||||
|
goto invalid_config;
|
||||||
|
}
|
||||||
|
|
||||||
pbe->config.real_bass_mix =
|
pbe->config.real_bass_mix =
|
||||||
GET_NEXT(values, param_max_offset, rc);
|
GET_NEXT(values, param_max_offset, rc);
|
||||||
pbe->config.bass_color_control =
|
pbe->config.bass_color_control =
|
||||||
@ -1002,6 +1011,15 @@ int msm_audio_effects_pbe_handler(struct audio_client *ac,
|
|||||||
pbe->config.reserved =
|
pbe->config.reserved =
|
||||||
GET_NEXT(values, param_max_offset, rc);
|
GET_NEXT(values, param_max_offset, rc);
|
||||||
|
|
||||||
|
if ((pbe->config.bandpass_filter_order > 3) ||
|
||||||
|
(pbe->config.bandpass_filter_order < 1)) {
|
||||||
|
pr_err("%s: Invalid BPF order\n",
|
||||||
|
__func__);
|
||||||
|
rc = -EINVAL;
|
||||||
|
goto invalid_config;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
p_coeffs = &pbe->config.p1LowPassCoeffs[0];
|
p_coeffs = &pbe->config.p1LowPassCoeffs[0];
|
||||||
lpf_len = (pbe->config.xover_filter_order == 3) ? 10 : 5;
|
lpf_len = (pbe->config.xover_filter_order == 3) ? 10 : 5;
|
||||||
hpf_len = (pbe->config.xover_filter_order == 3) ? 10 : 5;
|
hpf_len = (pbe->config.xover_filter_order == 3) ? 10 : 5;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@ -625,6 +625,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) &&
|
if ((prtd->mixer_conf.tx.enable || prtd->mixer_conf.rx.enable) &&
|
||||||
*no_of_tp == no_of_tp_req) {
|
*no_of_tp == no_of_tp_req) {
|
||||||
voc_send_cvp_start_vocpcm(voc_get_session_id(sess_name),
|
voc_send_cvp_start_vocpcm(voc_get_session_id(sess_name),
|
||||||
|
@ -1565,16 +1565,11 @@ static int32_t adm_callback(struct apr_client_data *data, void *priv)
|
|||||||
if (data->opcode == APR_BASIC_RSP_RESULT) {
|
if (data->opcode == APR_BASIC_RSP_RESULT) {
|
||||||
pr_debug("%s: APR_BASIC_RSP_RESULT id 0x%x\n",
|
pr_debug("%s: APR_BASIC_RSP_RESULT id 0x%x\n",
|
||||||
__func__, payload[0]);
|
__func__, payload[0]);
|
||||||
|
if (data->payload_size <
|
||||||
if (!((client_id != ADM_CLIENT_ID_SOURCE_TRACKING) &&
|
(2 * sizeof(uint32_t))) {
|
||||||
((payload[0] == ADM_CMD_SET_PP_PARAMS_V5) ||
|
pr_err("%s: Invalid payload size %d\n",
|
||||||
(payload[0] == ADM_CMD_SET_PP_PARAMS_V6)))) {
|
__func__, data->payload_size);
|
||||||
if (data->payload_size <
|
return 0;
|
||||||
(2 * sizeof(uint32_t))) {
|
|
||||||
pr_err("%s: Invalid payload size %d\n",
|
|
||||||
__func__, data->payload_size);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload[1] != 0) {
|
if (payload[1] != 0) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
|
||||||
|
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
@ -7014,6 +7015,14 @@ static int afe_sidetone_iir(u16 tx_port_id)
|
|||||||
pr_debug("%s: adding 2 to size:%d\n", __func__, size);
|
pr_debug("%s: adding 2 to size:%d\n", __func__, size);
|
||||||
size = size + 2;
|
size = size + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (size > MAX_SIDETONE_IIR_DATA_SIZE) {
|
||||||
|
pr_err("%s: iir_config size is out of bounds:%d\n", __func__, size);
|
||||||
|
mutex_unlock(&this_afe.cal_data[cal_index]->lock);
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(&filter_data.iir_config, &st_iir_cal_info->iir_config, size);
|
memcpy(&filter_data.iir_config, &st_iir_cal_info->iir_config, size);
|
||||||
mutex_unlock(&this_afe.cal_data[cal_index]->lock);
|
mutex_unlock(&this_afe.cal_data[cal_index]->lock);
|
||||||
|
|
||||||
@ -8322,6 +8331,7 @@ int afe_spk_prot_get_calib_data(struct afe_spkr_prot_get_vi_calib *calib_resp)
|
|||||||
struct param_hdr_v3 param_hdr;
|
struct param_hdr_v3 param_hdr;
|
||||||
int port = SLIMBUS_4_TX;
|
int port = SLIMBUS_4_TX;
|
||||||
int ret = -EINVAL;
|
int ret = -EINVAL;
|
||||||
|
uint32_t th_vi_ca_state;
|
||||||
|
|
||||||
if (!calib_resp) {
|
if (!calib_resp) {
|
||||||
pr_err("%s: Invalid params\n", __func__);
|
pr_err("%s: Invalid params\n", __func__);
|
||||||
@ -8343,6 +8353,12 @@ int afe_spk_prot_get_calib_data(struct afe_spkr_prot_get_vi_calib *calib_resp)
|
|||||||
__func__, port, param_hdr.param_id, ret);
|
__func__, port, param_hdr.param_id, ret);
|
||||||
goto get_params_fail;
|
goto get_params_fail;
|
||||||
}
|
}
|
||||||
|
th_vi_ca_state = this_afe.calib_data.res_cfg.th_vi_ca_state;
|
||||||
|
if (th_vi_ca_state < FBSP_INCORRECT_OP_MODE ||
|
||||||
|
th_vi_ca_state > MAX_FBSP_STATE) {
|
||||||
|
pr_err("%s: invalid fbsp state %d\n", __func__, th_vi_ca_state);
|
||||||
|
goto get_params_fail;
|
||||||
|
}
|
||||||
memcpy(&calib_resp->res_cfg, &this_afe.calib_data.res_cfg,
|
memcpy(&calib_resp->res_cfg, &this_afe.calib_data.res_cfg,
|
||||||
sizeof(this_afe.calib_data.res_cfg));
|
sizeof(this_afe.calib_data.res_cfg));
|
||||||
pr_info("%s: state %s resistance %d %d\n", __func__,
|
pr_info("%s: state %s resistance %d %d\n", __func__,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
|
||||||
|
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
* Author: Brian Swetland <swetland@google.com>
|
* Author: Brian Swetland <swetland@google.com>
|
||||||
*
|
*
|
||||||
* This software is licensed under the terms of the GNU General Public
|
* This software is licensed under the terms of the GNU General Public
|
||||||
@ -2288,6 +2289,16 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv)
|
|||||||
|
|
||||||
config_debug_fs_read_cb();
|
config_debug_fs_read_cb();
|
||||||
|
|
||||||
|
if (data->payload_size != (READDONE_IDX_SEQ_ID + 1) * sizeof(uint32_t)) {
|
||||||
|
pr_err("%s: payload size of %d is less than expected %d.\n",
|
||||||
|
__func__, data->payload_size,
|
||||||
|
((READDONE_IDX_SEQ_ID + 1) * sizeof(uint32_t)));
|
||||||
|
spin_unlock_irqrestore(
|
||||||
|
&(session[session_id].session_lock),
|
||||||
|
flags);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
dev_vdbg(ac->dev, "%s: ReadDone: status=%d buff_add=0x%x act_size=%d offset=%d\n",
|
dev_vdbg(ac->dev, "%s: ReadDone: status=%d buff_add=0x%x act_size=%d offset=%d\n",
|
||||||
__func__, payload[READDONE_IDX_STATUS],
|
__func__, payload[READDONE_IDX_STATUS],
|
||||||
payload[READDONE_IDX_BUFADD_LSW],
|
payload[READDONE_IDX_BUFADD_LSW],
|
||||||
@ -2394,7 +2405,16 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv)
|
|||||||
__func__, data->payload_size);
|
__func__, data->payload_size);
|
||||||
break;
|
break;
|
||||||
case ASM_SESSION_CMDRSP_GET_MTMX_STRTR_PARAMS_V2:
|
case ASM_SESSION_CMDRSP_GET_MTMX_STRTR_PARAMS_V2:
|
||||||
q6asm_process_mtmx_get_param_rsp(ac, (void *) payload);
|
payload_size = sizeof(struct asm_mtmx_strtr_get_params_cmdrsp);
|
||||||
|
if (data->payload_size < payload_size) {
|
||||||
|
pr_err("%s: insufficient payload size = %d\n",
|
||||||
|
__func__, data->payload_size);
|
||||||
|
spin_unlock_irqrestore(
|
||||||
|
&(session[session_id].session_lock), flags);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
q6asm_process_mtmx_get_param_rsp(ac,
|
||||||
|
(struct asm_mtmx_strtr_get_params_cmdrsp *) payload);
|
||||||
break;
|
break;
|
||||||
case ASM_STREAM_PP_EVENT:
|
case ASM_STREAM_PP_EVENT:
|
||||||
case ASM_STREAM_CMD_ENCDEC_EVENTS:
|
case ASM_STREAM_CMD_ENCDEC_EVENTS:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
|
||||||
|
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
@ -197,7 +198,7 @@ EXPORT_SYMBOL(q6core_send_uevent);
|
|||||||
static int parse_fwk_version_info(uint32_t *payload, uint16_t payload_size)
|
static int parse_fwk_version_info(uint32_t *payload, uint16_t payload_size)
|
||||||
{
|
{
|
||||||
size_t ver_size;
|
size_t ver_size;
|
||||||
int num_services;
|
uint16_t num_services;
|
||||||
|
|
||||||
pr_debug("%s: Payload info num services %d\n",
|
pr_debug("%s: Payload info num services %d\n",
|
||||||
__func__, payload[4]);
|
__func__, payload[4]);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2019, Linux Foundation. All rights reserved.
|
* Copyright (c) 2013-2019, Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
@ -1901,6 +1901,12 @@ static int q6lsm_mmapcallback(struct apr_client_data *data, void *priv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data->payload_size < (2 * sizeof(uint32_t))) {
|
||||||
|
pr_err("%s: payload has invalid size[%d]\n", __func__,
|
||||||
|
data->payload_size);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
command = payload[0];
|
command = payload[0];
|
||||||
retcode = payload[1];
|
retcode = payload[1];
|
||||||
sid = (data->token >> 8) & 0x0F;
|
sid = (data->token >> 8) & 0x0F;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
|
||||||
|
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/kthread.h>
|
#include <linux/kthread.h>
|
||||||
@ -2757,6 +2758,13 @@ static int voice_send_cvs_register_cal_cmd(struct voice_data *v)
|
|||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (col_data->cal_data.size >= MAX_COL_INFO_SIZE) {
|
||||||
|
pr_err("%s: Invalid cal data size %d!\n",
|
||||||
|
__func__, col_data->cal_data.size);
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(&cvs_reg_cal_cmd.cvs_cal_data.column_info[0],
|
memcpy(&cvs_reg_cal_cmd.cvs_cal_data.column_info[0],
|
||||||
(void *) &((struct audio_cal_info_voc_col *)
|
(void *) &((struct audio_cal_info_voc_col *)
|
||||||
col_data->cal_info)->data,
|
col_data->cal_info)->data,
|
||||||
@ -7898,7 +7906,7 @@ static int32_t qdsp_cvs_callback(struct apr_client_data *data, void *priv)
|
|||||||
VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_READY) {
|
VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_READY) {
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
u16 cvs_handle;
|
u16 cvs_handle;
|
||||||
uint32_t *cvs_voc_pkt;
|
uint32_t *cvs_voc_pkt, tot_buf_sz;
|
||||||
struct cvs_enc_buffer_consumed_cmd send_enc_buf_consumed_cmd;
|
struct cvs_enc_buffer_consumed_cmd send_enc_buf_consumed_cmd;
|
||||||
void *apr_cvs;
|
void *apr_cvs;
|
||||||
|
|
||||||
@ -7927,9 +7935,14 @@ static int32_t qdsp_cvs_callback(struct apr_client_data *data, void *priv)
|
|||||||
VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_CONSUMED;
|
VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_CONSUMED;
|
||||||
|
|
||||||
cvs_voc_pkt = v->shmem_info.sh_buf.buf[1].data;
|
cvs_voc_pkt = v->shmem_info.sh_buf.buf[1].data;
|
||||||
|
|
||||||
|
if (__builtin_add_overflow(cvs_voc_pkt[2], 3 * sizeof(uint32_t), &tot_buf_sz)) {
|
||||||
|
pr_err("%s: integer overflow detected\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (cvs_voc_pkt != NULL && common.mvs_info.ul_cb != NULL) {
|
if (cvs_voc_pkt != NULL && common.mvs_info.ul_cb != NULL) {
|
||||||
if (v->shmem_info.sh_buf.buf[1].size <
|
if (v->shmem_info.sh_buf.buf[1].size < tot_buf_sz) {
|
||||||
((3 * sizeof(uint32_t)) + cvs_voc_pkt[2])) {
|
|
||||||
pr_err("%s: invalid voc pkt size\n", __func__);
|
pr_err("%s: invalid voc pkt size\n", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
15
dsp/q6adm.c
15
dsp/q6adm.c
@ -1604,16 +1604,11 @@ static int32_t adm_callback(struct apr_client_data *data, void *priv)
|
|||||||
if (data->opcode == APR_BASIC_RSP_RESULT) {
|
if (data->opcode == APR_BASIC_RSP_RESULT) {
|
||||||
pr_debug("%s: APR_BASIC_RSP_RESULT id 0x%x\n",
|
pr_debug("%s: APR_BASIC_RSP_RESULT id 0x%x\n",
|
||||||
__func__, payload[0]);
|
__func__, payload[0]);
|
||||||
|
if (data->payload_size <
|
||||||
if (!((client_id != ADM_CLIENT_ID_SOURCE_TRACKING) &&
|
(2 * sizeof(uint32_t))) {
|
||||||
((payload[0] == ADM_CMD_SET_PP_PARAMS_V5) ||
|
pr_err("%s: Invalid payload size %d\n",
|
||||||
(payload[0] == ADM_CMD_SET_PP_PARAMS_V6)))) {
|
__func__, data->payload_size);
|
||||||
if (data->payload_size <
|
return 0;
|
||||||
(2 * sizeof(uint32_t))) {
|
|
||||||
pr_err("%s: Invalid payload size %d\n",
|
|
||||||
__func__, data->payload_size);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload[1] != 0) {
|
if (payload[1] != 0) {
|
||||||
|
17
dsp/q6lsm.c
17
dsp/q6lsm.c
@ -1,15 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2019, Linux Foundation. All rights reserved.
|
* Copyright (c) 2013-2019, Linux Foundation. All rights reserved.
|
||||||
*
|
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. 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
|
|
||||||
* only version 2 as published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*/
|
*/
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
@ -1823,6 +1814,12 @@ static int q6lsm_mmapcallback(struct apr_client_data *data, void *priv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data->payload_size < (2 * sizeof(uint32_t))) {
|
||||||
|
pr_err("%s: payload has invalid size[%d]\n", __func__,
|
||||||
|
data->payload_size);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
command = payload[0];
|
command = payload[0];
|
||||||
retcode = payload[1];
|
retcode = payload[1];
|
||||||
sid = (data->token >> 8) & 0x0F;
|
sid = (data->token >> 8) & 0x0F;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/kthread.h>
|
#include <linux/kthread.h>
|
||||||
@ -7777,7 +7777,7 @@ static int32_t qdsp_cvs_callback(struct apr_client_data *data, void *priv)
|
|||||||
VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_READY) {
|
VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_READY) {
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
u16 cvs_handle;
|
u16 cvs_handle;
|
||||||
uint32_t *cvs_voc_pkt;
|
uint32_t *cvs_voc_pkt, tot_buf_sz;
|
||||||
struct cvs_enc_buffer_consumed_cmd send_enc_buf_consumed_cmd;
|
struct cvs_enc_buffer_consumed_cmd send_enc_buf_consumed_cmd;
|
||||||
void *apr_cvs;
|
void *apr_cvs;
|
||||||
|
|
||||||
@ -7806,9 +7806,14 @@ static int32_t qdsp_cvs_callback(struct apr_client_data *data, void *priv)
|
|||||||
VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_CONSUMED;
|
VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_CONSUMED;
|
||||||
|
|
||||||
cvs_voc_pkt = v->shmem_info.sh_buf.buf[1].data;
|
cvs_voc_pkt = v->shmem_info.sh_buf.buf[1].data;
|
||||||
|
|
||||||
|
if (__builtin_add_overflow(cvs_voc_pkt[2], 3 * sizeof(uint32_t), &tot_buf_sz)) {
|
||||||
|
pr_err("%s: integer overflow detected\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (cvs_voc_pkt != NULL && common.mvs_info.ul_cb != NULL) {
|
if (cvs_voc_pkt != NULL && common.mvs_info.ul_cb != NULL) {
|
||||||
if (v->shmem_info.sh_buf.buf[1].size <
|
if (v->shmem_info.sh_buf.buf[1].size < tot_buf_sz) {
|
||||||
((3 * sizeof(uint32_t)) + cvs_voc_pkt[2])) {
|
|
||||||
pr_err("%s: invalid voc pkt size\n", __func__);
|
pr_err("%s: invalid voc pkt size\n", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user