Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Avoid dereferencing NULL rootvp if booting diskl...



details:   https://anonhg.NetBSD.org/src/rev/f7ec0f49361c
branches:  trunk
changeset: 476152:f7ec0f49361c
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Wed Sep 08 03:45:22 1999 +0000

description:
Avoid dereferencing NULL rootvp if booting diskless.

diffstat:

 sys/ufs/lfs/lfs_vfsops.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r c090d59120dd -r f7ec0f49361c sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c  Wed Sep 08 02:58:09 1999 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c  Wed Sep 08 03:45:22 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vfsops.c,v 1.36 1999/09/03 22:48:51 perseant Exp $ */
+/*     $NetBSD: lfs_vfsops.c,v 1.37 1999/09/08 03:45:22 sommerfeld Exp $       */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -164,6 +164,11 @@
        struct proc *p = curproc;       /* XXX */
        int error;
        
+       if (root_device->dv_class != DV_DISK)
+               return (ENODEV);
+
+       if (rootdev == NODEV)
+               return (ENODEV);
        /*
         * Get vnodes for swapdev and rootdev.
         */



Home | Main Index | Thread Index | Old Index