Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/kernfs check before deref kfs_kt



details:   https://anonhg.NetBSD.org/src/rev/d179bf0d1911
branches:  trunk
changeset: 551679:d179bf0d1911
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Sep 10 10:22:45 2003 +0000

description:
check before deref kfs_kt

diffstat:

 sys/miscfs/kernfs/kernfs_vnops.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 74f791dd1e3d -r d179bf0d1911 sys/miscfs/kernfs/kernfs_vnops.c
--- a/sys/miscfs/kernfs/kernfs_vnops.c  Wed Sep 10 09:59:47 2003 +0000
+++ b/sys/miscfs/kernfs/kernfs_vnops.c  Wed Sep 10 10:22:45 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernfs_vnops.c,v 1.95 2003/09/10 09:59:47 dan Exp $    */
+/*     $NetBSD: kernfs_vnops.c,v 1.96 2003/09/10 10:22:45 itojun Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.95 2003/09/10 09:59:47 dan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.96 2003/09/10 10:22:45 itojun Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -655,7 +655,7 @@
         * We don't guard the read from time(9) with splclock(9) since we
         * don't actually need to be THAT sure the access is atomic. 
         */
-       if (kfs->kfs_kt->kt_namlen == 8 && 
+       if (kfs->kfs_kt && kfs->kfs_kt->kt_namlen == 8 && 
            !memcmp(kfs->kfs_kt->kt_name, "boottime", 8)) {
                TIMEVAL_TO_TIMESPEC(&boottime, &vap->va_ctime);
        } else {



Home | Main Index | Thread Index | Old Index