diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-03-15 20:03:08 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-03-15 20:03:08 +0000 |
commit | 7a98474e0906ac069d94837486659e4625c3cf41 (patch) | |
tree | e6f4d0c586aa8b01085c657132c319cb6f998c96 /sys/arch/mac68k/dev | |
parent | b9a2c51f2cb93f4b6b2de48dc3ca86e1eef33511 (diff) |
Entries in cd_devs[] may be NULL, so be sure to check for them in your
device open() function.
Diffstat (limited to 'sys/arch/mac68k/dev')
-rw-r--r-- | sys/arch/mac68k/dev/asc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/mac68k/dev/asc.c b/sys/arch/mac68k/dev/asc.c index 9e196a90e3e..b11bbeba0a7 100644 --- a/sys/arch/mac68k/dev/asc.c +++ b/sys/arch/mac68k/dev/asc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asc.c,v 1.22 2006/01/22 18:37:56 miod Exp $ */ +/* $OpenBSD: asc.c,v 1.23 2006/03/15 20:03:06 miod Exp $ */ /* $NetBSD: asc.c,v 1.20 1997/02/24 05:47:33 scottr Exp $ */ /* @@ -196,9 +196,11 @@ ascopen(dev, flag, mode, p) int unit; unit = ASCUNIT(dev); - sc = asc_cd.cd_devs[unit]; if (unit >= asc_cd.cd_ndevs) return (ENXIO); + sc = asc_cd.cd_devs[unit]; + if (sc == NULL) + return (ENXIO); if (sc->sc_open) return (EBUSY); sc->sc_open = 1; |