aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/wcd9320.c8
1 files changed, 8 insertions, 0 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]);