diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-07-08 21:15:25 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-07-08 21:15:25 +0000 |
commit | 26072f16095311fc627c8dc846fb200710d87013 (patch) | |
tree | 90e5f7e5430853e4ac9fe1642ab289e01c98b1ea | |
parent | 540d2586b028e26b0a325b13fd1d7266fb55fb3f (diff) |
in addition to check cd_ndevs, also check that cd_devs[N] != NULL
-rw-r--r-- | sys/arch/sparc/dev/fga.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/sparc/dev/fga.c b/sys/arch/sparc/dev/fga.c index d38be028109..fc7afabcfcc 100644 --- a/sys/arch/sparc/dev/fga.c +++ b/sys/arch/sparc/dev/fga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fga.c,v 1.9 2002/04/30 01:12:29 art Exp $ */ +/* $OpenBSD: fga.c,v 1.10 2002/07/08 21:15:24 jason Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -610,8 +610,13 @@ fgaopen(dev, flags, mode, p) int flags, mode; struct proc *p; { + struct fga_softc *sc; + if (fga_cd.cd_ndevs == 0) return (ENXIO); + sc = fga_cd.cd_devs[0]; + if (sc == NULL) + return (ENXIO); return (0); } |