From 27021df2ff879d40002df59fb8a2246d0f6983df Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Sun, 22 Feb 2004 01:03:38 +0000 Subject: [PATCH] Fix off-by-one error: sc->twe_drive is an array of TWE_MAX_UNITS elements. Reported by: "Ted Unangst" Approved by: rwatson (mentor) --- sys/dev/twe/twe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/twe/twe.c b/sys/dev/twe/twe.c index 32cc61d6162..787c49b708d 100644 --- a/sys/dev/twe/twe.c +++ b/sys/dev/twe/twe.c @@ -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)