summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2014-10-06 07:22:48 +0000
committermjg <mjg@FreeBSD.org>2014-10-06 07:22:48 +0000
commitb14804421c993e68f61e00bcb774e6a6927cfdc7 (patch)
tree5516850cb55f06ca43440b64e2cd79a8d1182b82
parent72b086c52ce1483b4a1a258fce3db32ce687df75 (diff)
downloadFreeBSD-src-b14804421c993e68f61e00bcb774e6a6927cfdc7.zip
FreeBSD-src-b14804421c993e68f61e00bcb774e6a6927cfdc7.tar.gz
devfs: tidy up after 272596
This moves a var to an if statement, no functional changes. MFC after: 1 week
-rw-r--r--sys/fs/devfs/devfs_vnops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index 0317c69..d7009a4 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -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
OpenPOWER on IntegriCloud