svn commit: r285971 - stable/10/sys/kern

Conrad E. Meyer cem at FreeBSD.org
Tue Jul 28 18:37:24 UTC 2015


Author: cem
Date: Tue Jul 28 18:37:23 2015
New Revision: 285971
URL: https://svnweb.freebsd.org/changeset/base/285971

Log:
  MFC r285483: pipe_direct_write: Fix mismatched pipelock/unlock
  
  If a signal is caught in pipelock, causing it to fail, pipe_direct_write
  should not try to pipeunlock.
  
  Approved by:	markj (mentor)
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  stable/10/sys/kern/sys_pipe.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/sys_pipe.c
==============================================================================
--- stable/10/sys/kern/sys_pipe.c	Tue Jul 28 17:48:34 2015	(r285970)
+++ stable/10/sys/kern/sys_pipe.c	Tue Jul 28 18:37:23 2015	(r285971)
@@ -945,9 +945,10 @@ pipe_direct_write(wpipe, uio)
 retry:
 	PIPE_LOCK_ASSERT(wpipe, MA_OWNED);
 	error = pipelock(wpipe, 1);
-	if (wpipe->pipe_state & PIPE_EOF)
+	if (error != 0)
+		goto error1;
+	if ((wpipe->pipe_state & PIPE_EOF) != 0) {
 		error = EPIPE;
-	if (error) {
 		pipeunlock(wpipe);
 		goto error1;
 	}


More information about the svn-src-all mailing list