From 008f13bb6981e2f9ceec1a93cf59b4e82b3bd98d Mon Sep 17 00:00:00 2001 From: mycroft Date: Fri, 25 Mar 1994 04:38:01 +0000 Subject: Fix off-by-one error in comopen() unit number sanity check. From Brian de Alwis. --- sys/dev/ic/com.c | 4 ++-- sys/dev/isa/com.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 0ca439f9f19..058d6c8c828 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: com.c,v 1.27 1994/03/23 03:01:53 mycroft Exp $ + * $Id: com.c,v 1.28 1994/03/25 04:38:01 mycroft Exp $ */ /* @@ -279,7 +279,7 @@ comopen(dev, flag, mode, p) int s; int error = 0; - if (unit > NCOM) + if (unit >= NCOM) return ENXIO; sc = &com_softc[unit]; if (!sc->sc_iobase) diff --git a/sys/dev/isa/com.c b/sys/dev/isa/com.c index 0ca439f9f19..058d6c8c828 100644 --- a/sys/dev/isa/com.c +++ b/sys/dev/isa/com.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: com.c,v 1.27 1994/03/23 03:01:53 mycroft Exp $ + * $Id: com.c,v 1.28 1994/03/25 04:38:01 mycroft Exp $ */ /* @@ -279,7 +279,7 @@ comopen(dev, flag, mode, p) int s; int error = 0; - if (unit > NCOM) + if (unit >= NCOM) return ENXIO; sc = &com_softc[unit]; if (!sc->sc_iobase) -- cgit