Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Bail when dkdriver hasn't been initialized. This can...



details:   https://anonhg.NetBSD.org/src/rev/64584815cc7a
branches:  trunk
changeset: 965895:64584815cc7a
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Oct 05 05:28:44 2019 +0000

description:
Bail when dkdriver hasn't been initialized. This can happen when
attachment failed or when it hasn't finished yet.

diffstat:

 sys/dev/dksubr.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 8eac2a4a6613 -r 64584815cc7a sys/dev/dksubr.c
--- a/sys/dev/dksubr.c  Sat Oct 05 01:35:26 2019 +0000
+++ b/sys/dev/dksubr.c  Sat Oct 05 05:28:44 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.109 2019/06/28 14:56:46 jmcneill Exp $ */
+/* $NetBSD: dksubr.c,v 1.110 2019/10/05 05:28:44 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.109 2019/06/28 14:56:46 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.110 2019/10/05 05:28:44 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -147,6 +147,12 @@
                goto done;
        }
 
+       /* If no dkdriver attached, bail */
+       if (dkd == NULL) {
+               ret = ENXIO;
+               goto done;
+       }
+
        /*
         * initialize driver for the first opener
         */



Home | Main Index | Thread Index | Old Index