Fix off-by-one error: sc->twe_drive is an array of TWE_MAX_UNITS elements.

Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor)
This commit is contained in:
Colin Percival 2004-02-22 01:03:38 +00:00
parent e821c36489
commit 27021df2ff

View File

@ -273,7 +273,7 @@ twe_del_unit(struct twe_softc *sc, int unit)
{
int error;
if (unit < 0 || unit > TWE_MAX_UNITS)
if (unit < 0 || unit >= TWE_MAX_UNITS)
return (ENXIO);
if (sc->twe_drive[unit].td_disk == NULL)