Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Do not try to find the wedge we booted from if open...



details:   https://anonhg.NetBSD.org/src/rev/d4805248e28d
branches:  trunk
changeset: 779737:d4805248e28d
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jun 14 20:18:16 2012 +0000

description:
Do not try to find the wedge we booted from if opendisk(booted_device)
failed.

diffstat:

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

diffs (29 lines):

diff -r 0e2fdde71f46 -r d4805248e28d sys/kern/init_main.c
--- a/sys/kern/init_main.c      Thu Jun 14 18:56:54 2012 +0000
+++ b/sys/kern/init_main.c      Thu Jun 14 20:18:16 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_main.c,v 1.443 2012/06/10 17:05:18 mlelstv Exp $  */
+/*     $NetBSD: init_main.c,v 1.444 2012/06/14 20:18:16 martin Exp $   */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.443 2012/06/10 17:05:18 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.444 2012/06/14 20:18:16 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipsec.h"
@@ -852,6 +852,10 @@
                 * the disklabel.
                 */
                vp = opendisk(booted_device);
+
+               if (vp == NULL)
+                       return;
+
                error = VOP_IOCTL(vp, DIOCGPART, &dpart, FREAD, NOCRED);
                VOP_CLOSE(vp, FREAD, NOCRED);
                vput(vp);



Home | Main Index | Thread Index | Old Index