mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
Merge tag 'LA.UM.9.14.r1-26000-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into android13-5.4-lahaina
LA.UM.9.14.r1-26000-LAHAINA.QSSI15.0 # By Ratna Deepthi Kudaravalli # Via Linux Build Service Account (1) and Ratna Deepthi Kudaravalli (1) * tag 'clo/audio-kernel/LA.UM.9.14.r1-26000-LAHAINA.QSSI15.0': audio-kernel: avoid out of bound read while checking a bit Change-Id: I70a5aa2eb95361d9181d5e93a2bbbcce590ce7db
This commit is contained in:
commit
b483dce61a
2 changed files with 12 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2015, 2017-2018, 2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
|
|
@ -60,17 +61,17 @@ static int wcdcal_hwdep_ioctl_shared(struct snd_hwdep *hw,
|
|||
struct firmware_cal **fw = fw_data->fw;
|
||||
void *data;
|
||||
|
||||
if (!test_bit(fw_user.cal_type, fw_data->cal_bit)) {
|
||||
pr_err("%s: codec didn't set this %d!!\n",
|
||||
__func__, fw_user.cal_type);
|
||||
return -EFAULT;
|
||||
}
|
||||
if (fw_user.cal_type >= WCD9XXX_MAX_CAL ||
|
||||
fw_user.cal_type < WCD9XXX_MIN_CAL) {
|
||||
pr_err("%s: wrong cal type sent %d\n",
|
||||
__func__, fw_user.cal_type);
|
||||
return -EFAULT;
|
||||
}
|
||||
if (!test_bit(fw_user.cal_type, fw_data->cal_bit)) {
|
||||
pr_err("%s: codec didn't set this %d!!\n",
|
||||
__func__, fw_user.cal_type);
|
||||
return -EFAULT;
|
||||
}
|
||||
if (fw_user.size > cal_size_info[fw_user.cal_type] ||
|
||||
fw_user.size <= 0) {
|
||||
pr_err("%s: incorrect firmware size %d for %s\n",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2015, 2017 - 2018, 2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
|
@ -61,17 +62,17 @@ static int q6afecal_hwdep_ioctl_shared(struct snd_hwdep *hw,
|
|||
struct firmware_cal **fw = fw_data->fw;
|
||||
void *data;
|
||||
|
||||
if (!test_bit(fw_user.cal_type, fw_data->cal_bit)) {
|
||||
pr_err("%s: q6afe didn't set this %d!!\n",
|
||||
__func__, fw_user.cal_type);
|
||||
return -EFAULT;
|
||||
}
|
||||
if (fw_user.cal_type >= Q6AFE_MAX_CAL ||
|
||||
fw_user.cal_type < Q6AFE_MIN_CAL) {
|
||||
pr_err("%s: wrong cal type sent %d\n",
|
||||
__func__, fw_user.cal_type);
|
||||
return -EFAULT;
|
||||
}
|
||||
if (!test_bit(fw_user.cal_type, fw_data->cal_bit)) {
|
||||
pr_err("%s: q6afe didn't set this %d!!\n",
|
||||
__func__, fw_user.cal_type);
|
||||
return -EFAULT;
|
||||
}
|
||||
if (fw_user.size > cal_size_info[fw_user.cal_type] ||
|
||||
fw_user.size <= 0) {
|
||||
pr_err("%s: incorrect firmware size %d for %s\n",
|
||||
|
|
|
|||
Loading…
Reference in a new issue