From nobody Wed Apr 27 12:50:29 2022 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 B52351AAA5FD; Wed, 27 Apr 2022 12:50:30 +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 4KpJWT3Z51z4dct; Wed, 27 Apr 2022 12:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651063829; 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=6SZri3H56EZFhEQ0WDDLtae/OlYiJQejM6jzkIxFYqM=; b=v+O7HzGKaSiY+/pXz9zt0XjfuJQvfXfHMihwuKYE8Hw+2LzEx9NwXzhSzWrlpY/bW+6K0D ty9QSHoTIAdTOIygbuba5cjHmzq2OEERoK288kCCe+TBY0NVqrQfsJqGlVgkq+QMTCb8bX 2tO+YdgLJiq7YgPJIv8HQQWlisBpma1XHLlVqt4wM/6sQM9c+ClKygTg0hP8lDSGEFa5iJ 4ClfUUT6fBQRRRP88L5K26N4SYMYZgFgtPjQIfnbgbtiMu/tYOgQMtuSGUYyvCf2dzRZO4 fl+2Y7LlpkGGOC0sZw1H4OpdzJY5+K3RP+M+ykJN6ofHAREZV7cMC6WwH/V02w== 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 4828823ECD; Wed, 27 Apr 2022 12:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23RCoTSN011696; Wed, 27 Apr 2022 12:50:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23RCoTbS011695; Wed, 27 Apr 2022 12:50:29 GMT (envelope-from git) Date: Wed, 27 Apr 2022 12:50:29 GMT Message-Id: <202204271250.23RCoTbS011695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 5bc3ab86d619 - stable/12 - pf: remove pointless NULL check 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5bc3ab86d6191b1f96f2bc7011314d43c32492f3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651063829; 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=6SZri3H56EZFhEQ0WDDLtae/OlYiJQejM6jzkIxFYqM=; b=OWd4HeCyiHrUPBeZPYnG/kw+XhLYAk/V+4V5bSbQGZIEzTnkC2zA24SdNu+iDoYi+rcm5F 4K1FbqrmRY1ncteNln+H6ghJJ+m0DFRyN2471lasez6rQ/+ZEuKBXXa8m6eE4dXmBS9aX6 ZFkPgFo0QUWrJZfaNy3fob85JKO0OMiyKMPvyp6Z2jzI81b16hScABX8To0Zx0azn4/XxC JXODFKk2nd56pAbsLq4bk9Y/ekaqYhMjdKVaS7QPlBpuMJ45Mp/bLkHkKsMEq6uJt9qhKZ DT45XeD46D2bQkTFyp5SEQ05cMMFsXrzKVlWCsDZpXSM1XHUdBbZJ8DcBXzd5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651063829; a=rsa-sha256; cv=none; b=RIq7CoCNcfjAoj1NGeGlEx492fxkXk0ELe+d5iUrsVJ1R460LKzKoxGV/h0D2hVtbS3b1G S82gIiFGPzJ6GyQuL3q6fCqWgQ01baDW8VNanlz3YQvTZ/PeyDaLy18LcvvzU56CoMC+FJ rTUtfJkvh9dwHNBahqwk7dRZnlnaelQt7NNlol8CCac+hZFCl28uyvI8qXa/XmM6BmY2En bsd8CUKpJlJL3CRV75toRsjoBEp93UrmveHHzDnuGSQZapS/UNaPQ09AKvesE843Vu9Sg8 qY57LSVzCM9A6++hEY4BxwZvGvhlnSckUsN4kgw4vZd2/TpBKTS5tTrVqlzXtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5bc3ab86d6191b1f96f2bc7011314d43c32492f3 commit 5bc3ab86d6191b1f96f2bc7011314d43c32492f3 Author: Kristof Provost AuthorDate: 2022-04-21 12:33:48 +0000 Commit: Kristof Provost CommitDate: 2022-04-27 06:49:21 +0000 pf: remove pointless NULL check pfi_kkif_attach() always returns non-NULL, and we dereference the pointer before we check it, so that's pointless. Reported by: Coverity (CID 1007345) MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit ed6287c14168de409c5f333bda59896c8109eb70) --- sys/netpfil/pf/pf_if.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf_if.c b/sys/netpfil/pf/pf_if.c index ff2038138068..806718863f34 100644 --- a/sys/netpfil/pf/pf_if.c +++ b/sys/netpfil/pf/pf_if.c @@ -549,8 +549,7 @@ _bad: pfr_detach_table(dyn->pfid_kt); if (ruleset != NULL) pf_remove_if_empty_kruleset(ruleset); - if (dyn->pfid_kif != NULL) - pfi_kkif_unref(dyn->pfid_kif); + pfi_kkif_unref(dyn->pfid_kif); free(dyn, PFI_MTYPE); return (rv);