From 9e74d002e39f87b0ce974a4f9314b033674b6a6e Mon Sep 17 00:00:00 2001 From: hselasky Date: Thu, 25 Oct 2018 12:27:16 +0000 Subject: [PATCH] MFC r339581: Fix off-by-one which can lead to panics. Found by: Peter Holm Approved by: re (kib) 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 32ba8c881bd..65db6d5cd7c 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]; -- 2.45.0