diff options
| author | Mateusz Guzik <mjg@FreeBSD.org> | 2014-10-06 07:22:48 +0000 |
|---|---|---|
| committer | Mateusz Guzik <mjg@FreeBSD.org> | 2014-10-06 07:22:48 +0000 |
| commit | 3a222fe00084570292e6a97295716d447d4fd9b4 (patch) | |
| tree | 5516850cb55f06ca43440b64e2cd79a8d1182b82 /sys/fs/devfs | |
| parent | 9ee8d90af53136bc9f1e399e8655e867eef9e56c (diff) | |
Notes
Diffstat (limited to 'sys/fs/devfs')
| -rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 0317c695ef56d..d7009a49dd45a 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 |
