Merge "asoc: Fix out of bounds access in xt logging disable functions"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
980e17b489
@@ -282,6 +282,7 @@ struct msm_dai_q6_cdc_dma_dai_data {
|
|||||||
u32 channels;
|
u32 channels;
|
||||||
u32 bitwidth;
|
u32 bitwidth;
|
||||||
u32 is_island_dai;
|
u32 is_island_dai;
|
||||||
|
u32 xt_logging_disable;
|
||||||
union afe_port_config port_config;
|
union afe_port_config port_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2844,24 +2845,54 @@ static int msm_dai_q6_cal_info_get(struct snd_kcontrol *kcontrol,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_dai_q6_xt_logging_disable_put(struct snd_kcontrol *kcontrol,
|
static int msm_dai_q6_cdc_dma_xt_logging_disable_put(
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
{
|
{
|
||||||
struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data;
|
struct msm_dai_q6_cdc_dma_dai_data *dai_data = kcontrol->private_data;
|
||||||
|
|
||||||
dai_data->xt_logging_disable = ucontrol->value.integer.value[0];
|
if (dai_data) {
|
||||||
pr_debug("%s: setting xt logging disable to %d\n",
|
dai_data->xt_logging_disable = ucontrol->value.integer.value[0];
|
||||||
__func__, dai_data->xt_logging_disable);
|
pr_debug("%s: setting xt logging disable to %d\n",
|
||||||
|
__func__, dai_data->xt_logging_disable);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_dai_q6_xt_logging_disable_get(struct snd_kcontrol *kcontrol,
|
static int msm_dai_q6_cdc_dma_xt_logging_disable_get(
|
||||||
|
struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
struct msm_dai_q6_cdc_dma_dai_data *dai_data = kcontrol->private_data;
|
||||||
|
|
||||||
|
if (dai_data)
|
||||||
|
ucontrol->value.integer.value[0] = dai_data->xt_logging_disable;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_dai_q6_sb_xt_logging_disable_put(
|
||||||
|
struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
|
{
|
||||||
|
struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data;
|
||||||
|
|
||||||
|
if (dai_data) {
|
||||||
|
dai_data->xt_logging_disable = ucontrol->value.integer.value[0];
|
||||||
|
pr_debug("%s: setting xt logging disable to %d\n",
|
||||||
|
__func__, dai_data->xt_logging_disable);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_dai_q6_sb_xt_logging_disable_get(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
{
|
{
|
||||||
struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data;
|
struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data;
|
||||||
|
|
||||||
ucontrol->value.integer.value[0] = dai_data->xt_logging_disable;
|
if (dai_data)
|
||||||
|
ucontrol->value.integer.value[0] = dai_data->xt_logging_disable;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3726,8 +3757,8 @@ static const struct snd_kcontrol_new sb_config_controls[] = {
|
|||||||
msm_dai_q6_sb_format_get,
|
msm_dai_q6_sb_format_get,
|
||||||
msm_dai_q6_sb_format_put),
|
msm_dai_q6_sb_format_put),
|
||||||
SOC_ENUM_EXT("SLIM_0_RX XTLoggingDisable", xt_logging_disable_enum[0],
|
SOC_ENUM_EXT("SLIM_0_RX XTLoggingDisable", xt_logging_disable_enum[0],
|
||||||
msm_dai_q6_xt_logging_disable_get,
|
msm_dai_q6_sb_xt_logging_disable_get,
|
||||||
msm_dai_q6_xt_logging_disable_put),
|
msm_dai_q6_sb_xt_logging_disable_put),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt_proxy_config_controls[] = {
|
static const struct snd_kcontrol_new rt_proxy_config_controls[] = {
|
||||||
@@ -12028,8 +12059,8 @@ static const struct snd_kcontrol_new cdc_dma_config_controls[] = {
|
|||||||
msm_dai_q6_cdc_dma_format_put),
|
msm_dai_q6_cdc_dma_format_put),
|
||||||
SOC_ENUM_EXT("WSA_CDC_DMA_0 RX XTLoggingDisable",
|
SOC_ENUM_EXT("WSA_CDC_DMA_0 RX XTLoggingDisable",
|
||||||
xt_logging_disable_enum[0],
|
xt_logging_disable_enum[0],
|
||||||
msm_dai_q6_xt_logging_disable_get,
|
msm_dai_q6_cdc_dma_xt_logging_disable_get,
|
||||||
msm_dai_q6_xt_logging_disable_put),
|
msm_dai_q6_cdc_dma_xt_logging_disable_put),
|
||||||
};
|
};
|
||||||
|
|
||||||
/* SOC probe for codec DMA interface */
|
/* SOC probe for codec DMA interface */
|
||||||
|
Reference in New Issue
Block a user