Merge tag 'LA.UM.9.14.r1-22900.01-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into android13-5.4-lahaina

"LA.UM.9.14.r1-22900.01-LAHAINA.QSSI14.0"

* tag 'LA.UM.9.14.r1-22900.01-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel:
  ASoC: msm-audio-effects-q6-v2: Add BPF order check

Change-Id: I5b588f3b10e6efee554968284c1d2e1e606b8070
This commit is contained in:
Michael Bestas 2023-10-16 15:53:50 +03:00
commit 187f714733
No known key found for this signature in database
GPG Key ID: CC95044519BE6669

View File

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/slab.h>
@ -1002,6 +1003,14 @@ int msm_audio_effects_pbe_handler(struct audio_client *ac,
pbe->config.reserved =
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];
lpf_len = (pbe->config.xover_filter_order == 3) ? 10 : 5;
hpf_len = (pbe->config.xover_filter_order == 3) ? 10 : 5;