summaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-05-16 09:13:08 +0200
committerTakashi Iwai <tiwai@suse.de>2016-05-16 09:13:08 +0200
commit581abbaa03367f0b1327521f30bd2b69b8075b2f (patch)
tree686db8cee890fa97061baf5722c3bb9344e658dc /sound/isa
parent84add303ef950b8d85f54bc2248c2bc73467c329 (diff)
parent639db596165746ca87bbcb56559b094fd9042890 (diff)
downloadlinux-581abbaa03367f0b1327521f30bd2b69b8075b2f.tar.bz2
Merge branch 'for-next' into for-linus
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/wavefront/wavefront_synth.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index 69f76ff5693d..718d5e3b7806 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -785,6 +785,9 @@ wavefront_send_patch (snd_wavefront_t *dev, wavefront_patch_info *header)
DPRINT (WF_DEBUG_LOAD_PATCH, "downloading patch %d\n",
header->number);
+ if (header->number >= ARRAY_SIZE(dev->patch_status))
+ return -EINVAL;
+
dev->patch_status[header->number] |= WF_SLOT_FILLED;
bptr = buf;
@@ -809,6 +812,9 @@ wavefront_send_program (snd_wavefront_t *dev, wavefront_patch_info *header)
DPRINT (WF_DEBUG_LOAD_PATCH, "downloading program %d\n",
header->number);
+ if (header->number >= ARRAY_SIZE(dev->prog_status))
+ return -EINVAL;
+
dev->prog_status[header->number] = WF_SLOT_USED;
/* XXX need to zero existing SLOT_USED bit for program_status[i]
@@ -898,6 +904,9 @@ wavefront_send_sample (snd_wavefront_t *dev,
header->number = x;
}
+ if (header->number >= WF_MAX_SAMPLE)
+ return -EINVAL;
+
if (header->size) {
/* XXX it's a debatable point whether or not RDONLY semantics