Date: Wed, 27 Apr 2022 12:50:28 GMT From: Kristof Provost <kp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 397ccb080dca - stable/13 - pf: remove pointless NULL check Message-ID: <202204271250.23RCoSFE011671@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=397ccb080dca4bd475c82ed888107a33eb8f4c3f commit 397ccb080dca4bd475c82ed888107a33eb8f4c3f Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2022-04-21 12:33:48 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2022-04-27 06:46:48 +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 dcbbce08ed6c..cdde753c41b3 100644 --- a/sys/netpfil/pf/pf_if.c +++ b/sys/netpfil/pf/pf_if.c @@ -563,8 +563,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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202204271250.23RCoSFE011671>