]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/soc/codecs/88pm860x-codec.c
Merge remote-tracking branch 'asoc/topic/88pm860x' into asoc-next
[karo-tx-linux.git] / sound / soc / codecs / 88pm860x-codec.c
index 4633e51b15002083f52679c6d43b5e95950bab67..75d0ad5d2dcb38107934536ba7ef93410025c2f6 100644 (file)
@@ -309,6 +309,9 @@ static int snd_soc_put_volsw_2r_st(struct snd_kcontrol *kcontrol,
        val = ucontrol->value.integer.value[0];
        val2 = ucontrol->value.integer.value[1];
 
+       if (val >= ARRAY_SIZE(st_table) || val2 >= ARRAY_SIZE(st_table))
+               return -EINVAL;
+
        err = snd_soc_update_bits(codec, reg, 0x3f, st_table[val].m);
        if (err < 0)
                return err;