Fix off-by-one which can lead to panics.

Found by:		Peter Holm <peter@holm.cc>
MFC after:		3 days
Sponsored by:		Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2018-10-22 08:55:58 +00:00
parent 099c6f6d45
commit bb415b2a5f

View File

@ -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];