mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
dsp: afe: Add check for num_channels
Check for valid num_channels before accessing. Change-Id: I8f39d12e2f5f52fa145fbd3aed2b023afaa2b53b Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
This commit is contained in:
parent
fad96773ea
commit
2e8272c7f6
1 changed files with 4 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
@ -1249,6 +1249,9 @@ static int32_t afe_callback(struct apr_client_data *data, void *priv)
|
|||
sizeof(struct afe_port_mod_evt_rsp_hdr));
|
||||
uint32_t *dc_presence_flag = num_channels + 1;
|
||||
|
||||
if (*num_channels < 1 || *num_channels > 4)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < *num_channels; i++) {
|
||||
if (dc_presence_flag[i] == 1)
|
||||
dc_detected = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue