svn commit: r272600 - head/sys/fs/devfs

Mateusz Guzik mjg at FreeBSD.org
Mon Oct 6 07:22:49 UTC 2014


Author: mjg
Date: Mon Oct  6 07:22:48 2014
New Revision: 272600
URL: https://svnweb.freebsd.org/changeset/base/272600

Log:
  devfs: tidy up after 272596
  
  This moves a var to an if statement, no functional changes.
  
  MFC after:	1 week

Modified:
  head/sys/fs/devfs/devfs_vnops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c	Mon Oct  6 07:09:47 2014	(r272599)
+++ head/sys/fs/devfs/devfs_vnops.c	Mon Oct  6 07:22:48 2014	(r272600)
@@ -545,8 +545,8 @@ devfs_close(struct vop_close_args *ap)
 	 * if the reference count is 2 (this last descriptor
 	 * plus the session), release the reference from the session.
 	 */
-	oldvp = NULL;
 	if (td && vp == td->td_proc->p_session->s_ttyvp) {
+		oldvp = NULL;
 		sx_xlock(&proctree_lock);
 		if (vp == td->td_proc->p_session->s_ttyvp) {
 			SESS_LOCK(td->td_proc->p_session);
@@ -561,9 +561,9 @@ devfs_close(struct vop_close_args *ap)
 			SESS_UNLOCK(td->td_proc->p_session);
 		}
 		sx_xunlock(&proctree_lock);
+		if (oldvp != NULL)
+			vrele(oldvp);
 	}
-	if (oldvp != NULL)
-		vrele(oldvp);
 	/*
 	 * We do not want to really close the device if it
 	 * is still in use unless we are trying to close it


More information about the svn-src-all mailing list