dsp: fix out of bound access for cal_data size
Add change to fix cal_data index out of bounds error. Change-Id: I8c8e62835e496c0f35fdc09757f4206c52020727 Signed-off-by: Kunlei Zhang <kunleiz@codeaurora.org>
This commit is contained in:
1 parent
8d21f18fc8
commit
a323356e0c
1 file changed
+2
-4
+2
-4
@@ -10530,8 +10530,7 @@ static int afe_get_cal_spv4_ex_vi_ftm_param(int32_t cal_type, size_t data_size,
|
||||
pr_debug("%s: cal_type = %d\n", __func__, cal_type);
|
||||
if (this_afe.cal_data[AFE_FB_SPKR_PROT_V4_EX_VI_CAL] == NULL ||
|
||||
cal_data == NULL ||
|
||||
data_size > sizeof(*cal_data) ||
|
||||
data_size < sizeof(cal_data->cal_hdr))
|
||||
data_size != sizeof(*cal_data))
|
||||
goto done;
|
||||
|
||||
mutex_lock(&this_afe.cal_data[AFE_FB_SPKR_PROT_V4_EX_VI_CAL]->lock);
|
||||
@@ -10598,8 +10597,7 @@ static int afe_get_cal_sp_ex_vi_ftm_param(int32_t cal_type, size_t data_size,
|
||||
pr_debug("%s: cal_type = %d\n", __func__, cal_type);
|
||||
if (this_afe.cal_data[AFE_FB_SPKR_PROT_EX_VI_CAL] == NULL ||
|
||||
cal_data == NULL ||
|
||||
data_size > sizeof(*cal_data) ||
|
||||
data_size < sizeof(cal_data->cal_hdr))
|
||||
data_size != sizeof(*cal_data))
|
||||
goto done;
|
||||
|
||||
mutex_lock(&this_afe.cal_data[AFE_FB_SPKR_PROT_EX_VI_CAL]->lock);
|
||||
|
||||
Reference in new issue
Block a user