Fix handling of errors from sblock() in soreceive_stream().

Previously we would attempt to unlock the socket buffer despite having
failed to lock it.  Simply return an error instead: no resources need
to be released at this point, and doing so is consistent with
soreceive_generic().

PR:		238789
Submitted by:	Greg Becker <greg@codeconcepts.com>
MFC after:	1 week
This commit is contained in:
Mark Johnston 2019-07-02 14:24:42 +00:00
parent 73155b4327
commit 6d958292f3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349599

View File

@ -2200,7 +2200,7 @@ soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio,
/* Prevent other readers from entering the socket. */
error = sblock(sb, SBLOCKWAIT(flags));
if (error)
goto out;
return (error);
SOCKBUF_LOCK(sb);
/* Easy one, no space to copyout anything. */