aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2018-10-22 08:55:58 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2018-10-22 08:55:58 +0000
commitbb415b2a5f46d4579173d75f5451627b9d358ea8 (patch)
treefbcb8018d58d7d3aa02d2130edee6bfe6caadb7f /sys/dev/sound
parent099c6f6d45c0b4cd50d768428d6c1cf0ca93c624 (diff)
downloadsrc-bb415b2a5f46d4579173d75f5451627b9d358ea8.tar.gz
src-bb415b2a5f46d4579173d75f5451627b9d358ea8.zip
Fix off-by-one which can lead to panics.
Found by: Peter Holm <peter@holm.cc> MFC after: 3 days Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=339581
Diffstat (limited to 'sys/dev/sound')
-rw-r--r--sys/dev/sound/midi/sequencer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c
index 32ba8c881bda..65db6d5cd7cf 100644
--- a/sys/dev/sound/midi/sequencer.c
+++ b/sys/dev/sound/midi/sequencer.c
@@ -730,7 +730,7 @@ static int
seq_fetch_mid(struct seq_softc *scp, int unit, kobj_t *md)
{
- if (unit > scp->midi_number || unit < 0)
+ if (unit >= scp->midi_number || unit < 0)
return EINVAL;
*md = scp->midis[unit];