Lock the socket buffer before jumping to the 'out' label if sblock()

fails in t4_soreceive_ddp().
This commit is contained in:
John Baldwin 2015-01-26 16:32:41 +00:00
parent de5a10ecbc
commit 86f05ea6cf

View file

@ -1057,9 +1057,9 @@ t4_soreceive_ddp(struct socket *so, struct sockaddr **psa, struct uio *uio,
/* Prevent other readers from entering the socket. */
error = sblock(sb, SBLOCKWAIT(flags));
SOCKBUF_LOCK(sb);
if (error)
goto out;
SOCKBUF_LOCK(sb);
/* Easy one, no space to copyout anything. */
if (uio->uio_resid == 0) {