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;
        }
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to