git: ed6287c14168 - main - pf: remove pointless NULL check
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 21 Apr 2022 16:16:26 UTC
The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ed6287c14168de409c5f333bda59896c8109eb70 commit ed6287c14168de409c5f333bda59896c8109eb70 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2022-04-21 12:33:48 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2022-04-21 15:59:45 +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") --- 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);