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
This commit is contained in:
Conrad Meyer 2015-07-13 17:45:22 +00:00
parent 4ffa3da5f8
commit c578e0fb48
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285483

View File

@ -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;
}