svn commit: r349599 - head/sys/kern

Mark Johnston markj at FreeBSD.org
Tue Jul 2 14:24:43 UTC 2019


Author: markj
Date: Tue Jul  2 14:24:42 2019
New Revision: 349599
URL: https://svnweb.freebsd.org/changeset/base/349599

Log:
  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 at codeconcepts.com>
  MFC after:	1 week

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Tue Jul  2 12:22:54 2019	(r349598)
+++ head/sys/kern/uipc_socket.c	Tue Jul  2 14:24:42 2019	(r349599)
@@ -2200,7 +2200,7 @@ soreceive_stream(struct socket *so, struct sockaddr **
 	/* 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. */


More information about the svn-src-head mailing list