diff options
author | Mark Brown <broonie@kernel.org> | 2018-05-21 19:17:37 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-05-21 19:17:37 +0100 |
commit | 08556e03ad36b2c6219aba90de88ccf58038e208 (patch) | |
tree | 1619cc5f466534b66b351985526e82da32b52028 /sound/drivers/opl3 | |
parent | d1480f9b535fa3901b7f303959bc196b304472a9 (diff) | |
parent | 6ba89b52ba6916bc7a3d390d70951e992c0ca39e (diff) |
Merge tag 'v4.9.101' into linux-linaro-lsk-v4.9
This is the 4.9.101 stable release
Diffstat (limited to 'sound/drivers/opl3')
-rw-r--r-- | sound/drivers/opl3/opl3_synth.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c index ddcc1a325a61..42920a243328 100644 --- a/sound/drivers/opl3/opl3_synth.c +++ b/sound/drivers/opl3/opl3_synth.c @@ -21,6 +21,7 @@ #include <linux/slab.h> #include <linux/export.h> +#include <linux/nospec.h> #include <sound/opl3.h> #include <sound/asound_fm.h> @@ -448,7 +449,7 @@ static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * v { unsigned short reg_side; unsigned char op_offset; - unsigned char voice_offset; + unsigned char voice_offset, voice_op; unsigned short opl3_reg; unsigned char reg_val; @@ -473,7 +474,9 @@ static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * v voice_offset = voice->voice - MAX_OPL2_VOICES; } /* Get register offset of operator */ - op_offset = snd_opl3_regmap[voice_offset][voice->op]; + voice_offset = array_index_nospec(voice_offset, MAX_OPL2_VOICES); + voice_op = array_index_nospec(voice->op, 4); + op_offset = snd_opl3_regmap[voice_offset][voice_op]; reg_val = 0x00; /* Set amplitude modulation (tremolo) effect */ |