Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Apr 2012 16:26:27 +0000 (UTC)
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r234037 - stable/9/sys/kern
Message-ID:  <201204081626.q38GQRJk019424@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Sun Apr  8 16:26:26 2012
New Revision: 234037
URL: http://svn.freebsd.org/changeset/base/234037

Log:
  MFC: r232860
  
  Allways call fdrop().

Modified:
  stable/9/sys/kern/sys_capability.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/sys_capability.c
==============================================================================
--- stable/9/sys/kern/sys_capability.c	Sun Apr  8 13:44:55 2012	(r234036)
+++ stable/9/sys/kern/sys_capability.c	Sun Apr  8 16:26:26 2012	(r234037)
@@ -253,16 +253,14 @@ sys_cap_new(struct thread *td, struct ca
 		return (error);
 	AUDIT_ARG_FILE(td->td_proc, fp);
 	error = kern_capwrap(td, fp, rights, &capfd);
-	if (error)
-		return (error);
-
 	/*
 	 * Release our reference to the file (kern_capwrap has held a reference
 	 * for the filedesc array).
 	 */
 	fdrop(fp, td);
-	td->td_retval[0] = capfd;
-	return (0);
+	if (error == 0)
+		td->td_retval[0] = capfd;
+	return (error);
 }
 
 /*



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