aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wcd9320.c8
-rw-r--r--sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/sound/soc/codecs/wcd9320.c b/sound/soc/codecs/wcd9320.c
index 68c11c33b28..281688196a9 100644
--- a/sound/soc/codecs/wcd9320.c
+++ b/sound/soc/codecs/wcd9320.c
@@ -1306,7 +1306,15 @@ static int taiko_mad_input_put(struct snd_kcontrol *kcontrol,
taiko_mad_input = ucontrol->value.integer.value[0];
+ if (taiko_mad_input >= ARRAY_SIZE(taiko_conn_mad_text)) {
+ dev_err(codec->dev,
+ "%s: taiko_mad_input = %d out of bounds\n",
+ __func__, taiko_mad_input);
+ return -EINVAL;
+ }
+
micb_4_int_reg = taiko->resmgr.reg_addr->micb_4_int_rbias;
+
pr_debug("%s: taiko_mad_input = %s\n", __func__,
taiko_conn_mad_text[taiko_mad_input]);
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
index 35c83668827..c1dcd460436 100644
--- a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
+++ b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
@@ -1166,7 +1166,7 @@ static int msm_routing_set_multimedia2_vol_mixer(struct snd_kcontrol *kcontrol,
static int msm_routing_get_channel_map_mixer(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL];
+ char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL] = {0};
int i;
adm_get_multi_ch_map(channel_map);