From nobody Fri Jul 12 11:24:51 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 4WL8QC6PLSz5QBbp; Fri, 12 Jul 2024 11:24:51 +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 4WL8QC4k6zz4hq7; Fri, 12 Jul 2024 11:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720783491; 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=vD/ZvOWjAcX1O1aZd3G/UI55rtIqs5C+IcmMGhifC/4=; b=VBVOii6Vzct+Ifym5l4baE1Q0XIM5zlBKwOgnQ8SN/1op9mWX//lJ+Ob901qGL460hHW+j M33x8Tuzi7z2C3SNs0C7lC6xRaQTAUbV/jaiqmj5AUFwvpWnlBSoWVwqfX4dhc3AcQ0R3X VN3q3T7cBK7b6vDhmLodO7/gipTztCK7cXxVB3uHp9ZRXg2QUarWSdpiwIH2qtPZK2YTkP sT4UxyvsR1G/ASElD7Zj0jrJ2XsHXFEvNIqnnWpWcCRplugJikkp9tchmwyCWMf5VjsKZj +R2jrzRXeP9Zyjq2wQfOE4hppv3rGmY98P/TIT/V/Rk9rpCzx/mkIkw5MPOtuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720783491; a=rsa-sha256; cv=none; b=bP2ujUYqxpAbfPTNqqgaNYFnoGnrmJHFKJJD4ILv7iwQgD6g8wVqjiepaWcwyj4AyfvqHs Be0JpQtF1P9QMmpFiAjQ+lnPjK6mtLJjD3E/aivngSkm2uk2pSoTHmTFKCVuYxk8jtU8Gd WSnT7PgBZ6oLt7wrmx3vPS4rYO7t1LT2b9rbHM3HzjlrTd+f3ZesxP5V2uAifUE6bWplWY WL8ePnUrVwKfhAh6XRDmkFMS8qYrVI96pjd/PhMbxqDrp2L0rFIFpRH59hCNvBmlX1n6Kn ADjcIX3QLIe9+dpTyxYOnvDG3Ap8d4acZ5QmviVmKdpyZoXqJjvmxmTKLEYvfA== 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=1720783491; 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=vD/ZvOWjAcX1O1aZd3G/UI55rtIqs5C+IcmMGhifC/4=; b=p7G8+dHS46TVe4TCdXDGKEkeZvrJBQtuoNMrcfYXbu/rePxb4jHeNr8i3vi7M1hUNOhVcH BZfvmnHQ9lvQYbb5X4cc8eeqtd0KYC1d/VfaUyj8o0m4KIq+IKcyywPysBPIDQSxGoCMIC 0Tya7hKo6QiO8dXtBhwsM0WSYibYWIvUG3rB32Q/dISFX/4TfJvgGLSoBi1ItJ6SyfcPTY jTjBMWvhbazDnF5pkw5geC5xl14sWMgNd4sRbtdb/eUzdn9bu2dv1yf8ysUta1IdfH5btk 3xWP2NDU1KKQ+C3yQigd3UdsFI4ycckvMByQb4RrO+z/cLgalzgeboy4q8DpAg== 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 4WL8QC4KqXzhSX; Fri, 12 Jul 2024 11:24:51 +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 46CBOpJc092359; Fri, 12 Jul 2024 11:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46CBOpYj092356; Fri, 12 Jul 2024 11:24:51 GMT (envelope-from git) Date: Fri, 12 Jul 2024 11:24:51 GMT Message-Id: <202407121124.46CBOpYj092356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 7539b04ed7a4 - main - ipsec_newpolicies(): do not call key_freesp() with NULL value 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7539b04ed7a462afde4d3aaae7f6ba234a868158 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7539b04ed7a462afde4d3aaae7f6ba234a868158 commit 7539b04ed7a462afde4d3aaae7f6ba234a868158 Author: Konstantin Belousov AuthorDate: 2021-08-22 19:19:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-07-12 03:29:30 +0000 ipsec_newpolicies(): do not call key_freesp() with NULL value Sponsored by: NVIDIA networking MFC after: 1 week --- sys/net/if_ipsec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/net/if_ipsec.c b/sys/net/if_ipsec.c index 5f43225bfaed..b503d0696691 100644 --- a/sys/net/if_ipsec.c +++ b/sys/net/if_ipsec.c @@ -901,8 +901,10 @@ ipsec_newpolicies(struct ipsec_softc *sc, struct secpolicy *sp[IPSEC_SPCOUNT], } return (0); fail: - for (i = 0; i < IPSEC_SPCOUNT; i++) - key_freesp(&sp[i]); + for (i = 0; i < IPSEC_SPCOUNT; i++) { + if (sp[i] != NULL) + key_freesp(&sp[i]); + } return (ENOMEM); }