svn commit: r285483 - head/sys/kern

Conrad E. Meyer cem at FreeBSD.org
Mon Jul 13 17:45:23 UTC 2015


Author: cem
Date: Mon Jul 13 17:45:22 2015
New Revision: 285483
URL: https://svnweb.freebsd.org/changeset/base/285483

Log:
  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.
  
  Reported by:	pho
  Differential Revision:	https://reviews.freebsd.org/D3069
  Reviewed by:	kib
  Approved by:	markj (mentor)
  MFC after:	1 week
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/kern/sys_pipe.c

Modified: head/sys/kern/sys_pipe.c
==============================================================================
--- head/sys/kern/sys_pipe.c	Mon Jul 13 17:40:24 2015	(r285482)
+++ head/sys/kern/sys_pipe.c	Mon Jul 13 17:45:22 2015	(r285483)
@@ -946,9 +946,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