Module Name:    src
Committed By:   christos
Date:           Thu Apr 17 15:57:41 UTC 2014

Modified Files:
        src/sys/ufs/lfs: lfs_syscalls.c

Log Message:
CID/1203190: Fix NULL deref


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/sys/ufs/lfs/lfs_syscalls.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/ufs/lfs/lfs_syscalls.c
diff -u src/sys/ufs/lfs/lfs_syscalls.c:1.153 src/sys/ufs/lfs/lfs_syscalls.c:1.154
--- src/sys/ufs/lfs/lfs_syscalls.c:1.153	Wed Apr  9 18:44:15 2014
+++ src/sys/ufs/lfs/lfs_syscalls.c	Thu Apr 17 11:57:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_syscalls.c,v 1.153 2014/04/09 22:44:15 riastradh Exp $	*/
+/*	$NetBSD: lfs_syscalls.c,v 1.154 2014/04/17 15:57:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007, 2008
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.153 2014/04/09 22:44:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.154 2014/04/17 15:57:41 christos Exp $");
 
 #ifndef LFS
 # define LFS		/* for prototypes in syscallargs.h */
@@ -754,7 +754,8 @@ lfs_bmapv(struct proc *p, fsid_t *fsidp,
 				}
 				numrefed++;
 			} else {
-				mutex_exit(vp->v_interlock);
+				if (vp != null)
+					mutex_exit(vp->v_interlock);
 				mutex_exit(&ulfs_ihash_lock);
 				/*
 				 * Don't VFS_VGET if we're being unmounted,

Reply via email to