Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev Pull up following revision(s) (requested by mlels...



details:   https://anonhg.NetBSD.org/src/rev/cb5939e6fa86
branches:  netbsd-8
changeset: 744722:cb5939e6fa86
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Feb 11 08:39:01 2020 +0000

description:
Pull up following revision(s) (requested by mlelstv in ticket #1500):

        sys/dev/ld.c: revision 1.108

Reject open when attach didn't complete successfully.

diffstat:

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

diffs (29 lines):

diff -r 096cf0b4269c -r cb5939e6fa86 sys/dev/ld.c
--- a/sys/dev/ld.c      Mon Feb 10 16:51:59 2020 +0000
+++ b/sys/dev/ld.c      Tue Feb 11 08:39:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ld.c,v 1.101.2.2 2018/12/04 12:00:41 martin Exp $      */
+/*     $NetBSD: ld.c,v 1.101.2.3 2020/02/11 08:39:01 martin Exp $      */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.101.2.2 2018/12/04 12:00:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.101.2.3 2020/02/11 08:39:01 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -290,6 +290,10 @@
        unit = DISKUNIT(dev);
        if ((sc = device_lookup_private(&ld_cd, unit)) == NULL)
                return (ENXIO);
+
+       if ((sc->sc_flags & LDF_ENABLED) == 0)
+               return (ENODEV);
+
        dksc = &sc->sc_dksc;
 
        return dk_open(dksc, dev, flags, fmt, l);



Home | Main Index | Thread Index | Old Index