Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jul 2019 14:24:42 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349599 - head/sys/kern
Message-ID:  <201907021424.x62EOgeD044908@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907021424.x62EOgeD044908>