mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
Merge "dsp: afe: Add check for sidetone iir config copy size"
This commit is contained in:
commit
1ec47d24b6
1 changed files with 9 additions and 1 deletions
10
dsp/q6afe.c
10
dsp/q6afe.c
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
#include <linux/slab.h>
|
||||
#include <linux/debugfs.h>
|
||||
|
|
@ -8652,6 +8652,14 @@ static int afe_sidetone_iir(u16 tx_port_id)
|
|||
pr_debug("%s: adding 2 to size:%d\n", __func__, size);
|
||||
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);
|
||||
mutex_unlock(&this_afe.cal_data[cal_index]->lock);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue