Module Name:    src
Committed By:   martin
Date:           Thu Sep 26 18:23:13 UTC 2019

Modified Files:
        src/sys/dev/ic [netbsd-8]: nvme.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1390):

        sys/dev/ic/nvme.c: revision 1.46

nvme(4): Don't attach the device, if namespace not found.


To generate a diff of this commit:
cvs rdiff -u -r1.30.2.5 -r1.30.2.6 src/sys/dev/ic/nvme.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/nvme.c
diff -u src/sys/dev/ic/nvme.c:1.30.2.5 src/sys/dev/ic/nvme.c:1.30.2.6
--- src/sys/dev/ic/nvme.c:1.30.2.5	Wed Sep 25 15:49:16 2019
+++ src/sys/dev/ic/nvme.c	Thu Sep 26 18:23:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvme.c,v 1.30.2.5 2019/09/25 15:49:16 martin Exp $	*/
+/*	$NetBSD: nvme.c,v 1.30.2.6 2019/09/26 18:23:13 martin Exp $	*/
 /*	$OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.30.2.5 2019/09/25 15:49:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.30.2.6 2019/09/26 18:23:13 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -397,6 +397,10 @@ nvme_attach(struct nvme_softc *sc)
 		aprint_error_dev(sc->sc_dev, "unable to identify controller\n");
 		goto disable;
 	}
+	if (sc->sc_nn == 0) {
+		aprint_error_dev(sc->sc_dev, "namespace not found\n");
+		goto disable;
+	}
 
 	/* we know how big things are now */
 	sc->sc_max_sgl = sc->sc_mdts / sc->sc_mps;

Reply via email to