From nobody Fri Jun 19 04:05:14 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ghPBg1Gs2z6hPm8 for ; Fri, 19 Jun 2026 04:05:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghPBf3qszz3XHs for ; Fri, 19 Jun 2026 04:05:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4d+kojDTVljzsH7pqUjwRSQRRzyjXil3dIEK05K9bG8=; b=ON7s7UwRtbCT4ZeJsrID2d3SkLUWFmigKtgPVB9pS4+WhikGbY8I7nx8SpymILWheqNDW1 WJf4dzqUB5M1yHIXY+Xa9KhyWgSXVZ+YqUWJeO//Nw5MCiqmRnCtCQcB6LHxjMmp1MLsOY mz695gejZyGIGeKTTqFMdFdbNnxZtegsuyKXozn3gAlVy0HRY/eux9F5eN5R8wANzobKjg emzITr+syRuU6CtilXKRWEt/Tdwlw3igquAIvnXoqA1Vf05pYX8D++dvmWtSpK39QykwJA 28pbMKBRZ5Yr/zeP6RrENgtCDuAtkvREDXd7DmIfvg1Fd1dbldXQ5iaOdtlAYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781841914; a=rsa-sha256; cv=none; b=Hv+Vam9R8nmWabC+pn+dMPtGgAL5kx7R3Ds/9JzhAqM2Nf6Fg4XdilMZ1wRVZrTCSg/153 VP4XBsU0fRtK8powHn4mvW/tA5j0z0FmaH7SI0iPea0hiESmGmmQXLo4eSaWW/6oXJUJAE 5Jn89AXUeytL9csLPRV6f8n8WmVM71Wd0O9Iu9ShxLeUHvmi2Cuyd1yGLkCFw+V2XfGdfm Qch3UEX1PtxTpY+mXewkIDMNaowGAQRehW7QBhr+DeRacywbam8PsBAqjV0Pf7UNG3055M JtIYWMYmv+4yLA1+jK9h3pz78DAVKF26VptONhMwkZ5krKiFECKv0Y49QloAlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4d+kojDTVljzsH7pqUjwRSQRRzyjXil3dIEK05K9bG8=; b=OszvX0h4Yi+JH8LmREkY0KnQtuaiyaF3tGmgqsitbApStU6hKhR4AeAqxqO4u9Mq7aWacS 6+xsaIfPHit+SyfBGW6LfE5W52imnGcN1wN6tI6ZzpH3jnsS6jxOjL4a5h2dxOZMn7N7uP qQfIToPAKmmxm2VFsMMZXGdk8VlXP6LkniOnrFe6fV4Iaol1GDT77zFwlLeV0cOD39bP/b qyDlkggjxN/xETqliAruuisoULQ3bKYpVMlALgKq59umLaIhM56b0YGmYOFSjWPL5QQanX XN8kchIyUFewnBUJhLynvXB66ID9YKb4XmSf//IZNsI0CH1g7MtDpYVGnvYfUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghPBf2jN3zD0w for ; Fri, 19 Jun 2026 04:05:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1a398 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 04:05:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8a3d28375450 - main - socket: remove tautological condition in so_unsplice() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a3d28375450946e4b0de239c9239df54c22d298 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 04:05:14 +0000 Message-Id: <6a34bffa.1a398.3a01a240@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8a3d28375450946e4b0de239c9239df54c22d298 commit 8a3d28375450946e4b0de239c9239df54c22d298 Author: Kyle Evans AuthorDate: 2026-06-19 04:03:30 +0000 Commit: Kyle Evans CommitDate: 2026-06-19 04:03:30 +0000 socket: remove tautological condition in so_unsplice() so2rele was introduced in 1000cc4a0d3 and it was necessary there, but the cleanup in a837d1fe49e0255 rendered it redundant if our own KASSERT is to be believed: we've asserted that `so2->so_splice_back == sp` and `sp` has been dereferenced above, so there's no condition left where we shouldn't release the socket reference at the end. Indeed, the change in so_splice() to NULL out sp->dst removes that possible state of a partially constructed splice: if sp->dst is set, it has been ref'd. Reviewed by: gallatin, markj Differential Revision: https://reviews.freebsd.org/D57558 --- sys/kern/uipc_socket.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index c7a7fdd44aa0..82a8ce8feb8c 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1805,7 +1805,7 @@ so_unsplice(struct socket *so, bool timeout) { struct socket *so2; struct so_splice *sp; - bool drain, so2rele; + bool drain; /* * First unset SB_SPLICED and hide the splice structure so that @@ -1850,7 +1850,6 @@ so_unsplice(struct socket *so, bool timeout) KASSERT(so2->so_splice_back == sp, ("%s: so_splice_back != sp", __func__)); so2->so_snd.sb_flags &= ~SB_SPLICED; - so2rele = so2->so_splice_back != NULL; so2->so_splice_back = NULL; SOCK_SENDBUF_UNLOCK(so2); SOCK_UNLOCK(so2); @@ -1896,8 +1895,7 @@ so_unsplice(struct socket *so, bool timeout) sorele(so); if (so2 != NULL) { sowwakeup(so2); - if (so2rele) - sorele(so2); + sorele(so2); } CURVNET_RESTORE(); so_splice_free(sp);