From 8d27d23671448a7fde5f43b79e5f5ac08ac8c40d Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Thu, 25 Oct 2018 14:38:03 +0000 Subject: MFC r339581: Fix off-by-one which can lead to panics. Found by: Peter Holm Sponsored by: Mellanox Technologies --- sys/dev/sound/midi/sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index 1ef784599e4e..abfb662fc931 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -737,7 +737,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]; -- cgit v1.3