Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2012 21:38:07 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r237034 - head/sys/kern
Message-ID:  <201206132138.q5DLc76r050484@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Wed Jun 13 21:38:07 2012
New Revision: 237034
URL: http://svn.freebsd.org/changeset/base/237034

Log:
  Now that dupfdopen() doesn't depend on finstall() being called earlier,
  indx will never be -1 on error, as none of dupfdopen(), finstall() and
  kern_capwrap() modifies it on error, but what is more important none of
  those functions install and leave file at indx descriptor on error.
  
  Leave an assert to prove my words.
  
  MFC after:	1 month

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Wed Jun 13 21:32:35 2012	(r237033)
+++ head/sys/kern/vfs_syscalls.c	Wed Jun 13 21:38:07 2012	(r237034)
@@ -1237,8 +1237,7 @@ success:
 bad:
 	VFS_UNLOCK_GIANT(vfslocked);
 bad_unlocked:
-	if (indx != -1)
-		fdclose(fdp, fp, indx, td);
+	KASSERT(indx == -1, ("indx=%d, should be -1", indx));
 	fdrop(fp, td);
 	return (error);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206132138.q5DLc76r050484>