git: 5bc3ab86d619 - stable/12 - pf: remove pointless NULL check
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 27 Apr 2022 12:50:29 UTC
The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5bc3ab86d6191b1f96f2bc7011314d43c32492f3 commit 5bc3ab86d6191b1f96f2bc7011314d43c32492f3 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: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);