From nobody Mon Apr 01 19:57:22 2024 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 4V7hcf5Fmyz5Gl9j; Mon, 1 Apr 2024 19:57:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7hcf4nXPz3yhv; Mon, 1 Apr 2024 19:57:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712001442; 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=/YfNoQuIsIzRffGXqFOENuXLz9wO1iIy0u5CVz9EAdg=; b=QR69S6YV0dDQwOn8FnFykTWQXROHmleD1xxH+ziFYcccdvTWjRCuzIMFfGMIUFmS9jvfHo wlgcO2YcCCNUvqiOZiuqv3xflIp74HpstJUTXhobN2egk5p/HPixKVQUxb5M0cxUQD35+2 Wo+kQfVTlxQzKoIO/c29KOyKAvjW0bwIajMa+yGb6vso72zznIkwe6tdE377Gw98gPX5+D 269bF+MO74HhDn7nMQO0p4pM5PQN2aQ568lebqrXEyeCdTj04Qq7p/vW5qwK6SRpQakGuW bTpbidmC/57a5A/PDqon8G5o9SbsYuxCQOit+Scao2aEgBeTHKyExnV6IVxkkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712001442; a=rsa-sha256; cv=none; b=rMRmK48CgZrZ/2sYW+NvsJl5fv0UH9GtoYgoaIOqFbmkqAW9qf4b2Lrk3bG861ZvdX5HvG gYIeI90Xi55/xtWYu4Ec61EUU7AZGaiQYltKkduWUfxWnPXo2dtccZqwWwVTBoQ+JGIY4w 2V+SulJ6Drm5uVLRwXKqraJRF+EKE+zc9Ue9C21BNvEClOoYW/BOYa4QyeOMEgptGW/ZXZ LfV/RIwAuGmSLaxBXEwXsbp8S2ExZBrg1WaFVNqKGhJ5ShwjtP0MhgOhv+jTSykeqKoA4Q XTBfMY3AQkTpHos8CbMA7R+yjyierL76g7msvpfU7RaG7f3YfEdY3vQvSsW4Lg== 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=1712001442; 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=/YfNoQuIsIzRffGXqFOENuXLz9wO1iIy0u5CVz9EAdg=; b=X81Pqbp5DKYfsgtcX7knIm33s/FtT7TyOVM+p1hqGC7I2X3NpIlp1L0StVi6Gr810qzcZ8 Bxqex9ZiekFgHhXRqS8CSrOH2+wYzHQG1tTUIm/UZa7psy/RpTVSURg8pX6i++vxYsosip kOB1Ftl7MQViFF8RiI8v1Gpiq4+zsmE5GLRPuEU/w2A9D6z3gY+lJLPm+gaeuait2WGYhw 3DET3s0M9wON59/lFg3ZWB8njaHpNNgdlmmm453W8ZsW7SfRt0wXekqlQlUO4gyPc0Hm4t lUcVTo3FEwhgw4MZLnnEUjOYAIHL3ZGgL6/0aHgQrkEu5aXz1O+9CdnWLzeLAg== 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 4V7hcf4Nn5zJhy; Mon, 1 Apr 2024 19:57:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431JvMxD094483; Mon, 1 Apr 2024 19:57:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431JvMfC094480; Mon, 1 Apr 2024 19:57:22 GMT (envelope-from git) Date: Mon, 1 Apr 2024 19:57:22 GMT Message-Id: <202404011957.431JvMfC094480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: b600644fdd6c - main - tcp hpts: improve consistency 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: b600644fdd6cefb1b90d76fdd5aa595946611a7d Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b600644fdd6cefb1b90d76fdd5aa595946611a7d commit b600644fdd6cefb1b90d76fdd5aa595946611a7d Author: Michael Tuexen AuthorDate: 2024-04-01 19:51:59 +0000 Commit: Michael Tuexen CommitDate: 2024-04-01 19:51:59 +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 MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44527 --- 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 222f8e0229dd..1e6578429acd 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -759,7 +759,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 { /*