From nobody Thu Aug 01 20:28:42 2024 X-Original-To: dev-commits-src-all@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 4WZgXV4MXpz5RPV3; Thu, 01 Aug 2024 20:28:42 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgXV3rCjz4Jvr; Thu, 1 Aug 2024 20:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544122; 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=jVtFfNHYFCErao+3L6HmDmCr1NsScuX+QtNpOihPOas=; b=hyjubZoPuXiOzp2vaMGYWfo8voHXvBDuDxRQdwmnFrBSr3SqFCLsrbxIhNxfnPh7CYTuI4 DB5zq34vUU/jFy9r/ayKrtBWrvkzCnpFX8hSudUBqZfd2BjoII0uKX9ywUEOheacVky7wf Pt1YA40AFkhOiy5L8iqcTpgYPXKDUZ+p68ok1AsbMz8PB/tjxXvbWuJM8Y+sJ30vex9aC8 gDvX2AjOX7ed6pNxu8G24O9z/rLqTgVgxS9Dj+jDU5deyu2Ch45GMldbNUqCrNAxvoJL/1 HWIlXoNwTPJgUwrGbrkoz2QWjf+4PSYuVs+577iqD7B1BOCDHdAYE0Q7cuoSoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722544122; a=rsa-sha256; cv=none; b=G0CpfJnQ0vT9rc72hhz0sLVtT5PCaN5OZL+TZ3a7RFlXeygfEf8Yi4s6BX1KKBx897sHFC lseW9WlN82zzhk74HWTNOAHKiy/HLEXVh2eByKywYt/pYZsiCX7aEW8pEOZRfSaNeVub/I 3iL8SAKXr0xeT3SwGw9bpK+D+Zj8tT4yjUcCWoQRThhVC4C1X9zUNjzAKk8F+Qwz4YqyL8 VIs+p2W+nhFOAY09GNCScrp0aZcEq0pTxQv20m4HuGR6guRWRrIrysSO1QSL6ccD/gIY29 iaWS8R+EMMYVJtZzckugim/3JoizsyymntYjRm5JdHV2p0vTpOip6EwgskiqJA== 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=1722544122; 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=jVtFfNHYFCErao+3L6HmDmCr1NsScuX+QtNpOihPOas=; b=yEz5Mc3f61A03XKFqQu2rpcbaVU9QaZFmFuZKAstMDGcBdj/4bwMEuBYyPxh6CuYevmDmn vppQ1jYOUS5+CZpJjPS261NQSN5aqSWHm5tiTPM0EnWTILkcj/+tdlBWZbfX+o+NT93gNR uSKvI2nfx/v8aQRlMk8chcYnvlvoPzYyJMz00/TLxJnRrq2Q4stKXlAM4KCyVXotfQyGpP 515lg8dSwmfkwg5Vwyh5548MHXGyrp3ZEvr0RuH9dOGQvGT1FnRZVst3w2768l9Wo3MtKo QJHqnCa0wU94kWsfDeJzBhDuG4WiUotC0yjujIt9SEM651/ODXOG/oQAEhuvIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgXV3Rb5z10Jn; Thu, 1 Aug 2024 20:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471KSg8R021175; Thu, 1 Aug 2024 20:28:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KSgte021172; Thu, 1 Aug 2024 20:28:42 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:28:42 GMT Message-Id: <202408012028.471KSgte021172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: d341a5645144 - stable/13 - tcp hpts: improve consistency List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d341a5645144da014cb800dc98ed5c785df504f4 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d341a5645144da014cb800dc98ed5c785df504f4 commit d341a5645144da014cb800dc98ed5c785df504f4 Author: Michael Tuexen AuthorDate: 2024-04-01 19:51:59 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:28:16 +0000 tcp hpts: improve consistency The target_slot argument of max_slots_available() can be NULL. Therefore, check for this in all places. Right now, all callers provide non-NULL pointer. Reported by: Coverity Scan CID: 1527732 Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44527 (cherry picked from commit b600644fdd6cefb1b90d76fdd5aa595946611a7d) --- sys/netinet/tcp_hpts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 18576e181b6f..4c177367a7ea 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -796,7 +796,8 @@ max_slots_available(struct tcp_hpts_entry *hpts, uint32_t wheel_slot, uint32_t * * "0". */ counter_u64_add(combined_wheel_wrap, 1); - *target_slot = hpts->p_nxt_slot; + if (target_slot) + *target_slot = hpts->p_nxt_slot; return (0); } else { /*