aboutsummaryrefslogtreecommitdiffstats
path: root/sound/synth/emux/emux_nrpn.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/synth/emux/emux_nrpn.c')
-rw-r--r--sound/synth/emux/emux_nrpn.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/synth/emux/emux_nrpn.c b/sound/synth/emux/emux_nrpn.c
index 9729a15b6ae6..f4aa2706aeb6 100644
--- a/sound/synth/emux/emux_nrpn.c
+++ b/sound/synth/emux/emux_nrpn.c
@@ -363,6 +363,9 @@ int
snd_emux_xg_control(struct snd_emux_port *port, struct snd_midi_channel *chan,
int param)
{
+ if (param >= ARRAY_SIZE(chan->control))
+ return -EINVAL;
+
return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects),
port, chan, param,
chan->control[param],