summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sparc/dev/flash.c')
-rw-r--r--sys/arch/sparc/dev/flash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/arch/sparc/dev/flash.c b/sys/arch/sparc/dev/flash.c
index 5f3611f9440..769d21450a9 100644
--- a/sys/arch/sparc/dev/flash.c
+++ b/sys/arch/sparc/dev/flash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: flash.c,v 1.4 2006/03/04 12:38:58 miod Exp $ */
+/* $OpenBSD: flash.c,v 1.5 2006/03/15 20:03:06 miod Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -125,6 +125,8 @@ flashopen(dev, flags, mode, p)
if (card >= flash_cd.cd_ndevs)
return (ENXIO);
sc = flash_cd.cd_devs[card];
+ if (sc == NULL)
+ return (ENXIO);
if (sc->sc_open)
return (EBUSY);
sc->sc_open = 1;