From owner-svn-src-all@FreeBSD.ORG Mon Oct 6 07:22:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CD74AEF; Mon, 6 Oct 2014 07:22:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39FFCBD0; Mon, 6 Oct 2014 07:22:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s967MnmB008311; Mon, 6 Oct 2014 07:22:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s967Mnjv008310; Mon, 6 Oct 2014 07:22:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410060722.s967Mnjv008310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 6 Oct 2014 07:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272600 - head/sys/fs/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2014 07:22:49 -0000 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