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:
parent
099c6f6d45
commit
bb415b2a5f
@ -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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user