Skip to content

Commit

Permalink
pf: remove pointless NULL check
Browse files Browse the repository at this point in the history
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 ed6287c)
  • Loading branch information
kprovost authored and fichtner committed Jun 8, 2022
1 parent 1b73255 commit d45e651
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sys/netpfil/pf/pf_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,7 @@ pfi_dynaddr_setup(struct pf_addr_wrap *aw, sa_family_t af)
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);
Expand Down

0 comments on commit d45e651

Please sign in to comment.