diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -624,10 +624,8 @@ cleanup_state: /* pf_state_insert() frees the state keys. */ if (st) { for (int i = 0; i < 2; i++) { - if (st->packets[i] != NULL) - counter_u64_free(st->packets[i]); - if (st->bytes[i] != NULL) - counter_u64_free(st->bytes[i]); + counter_u64_free(st->packets[i]); + counter_u64_free(st->bytes[i]); } if (st->dst.scrub) uma_zfree(V_pf_state_scrub_z, st->dst.scrub); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -707,10 +707,8 @@ { for (int i = 0; i < 2; i++) { - if (sn->bytes[i]) - counter_u64_free(sn->bytes[i]); - if (sn->packets[i]) - counter_u64_free(sn->packets[i]); + counter_u64_free(sn->bytes[i]); + counter_u64_free(sn->packets[i]); } uma_zfree(V_pf_sources_z, sn); } @@ -1739,10 +1737,8 @@ cur->timeout)); for (int i = 0; i < 2; i++) { - if (cur->bytes[i] != NULL) - counter_u64_free(cur->bytes[i]); - if (cur->packets[i] != NULL) - counter_u64_free(cur->packets[i]); + counter_u64_free(cur->bytes[i]); + counter_u64_free(cur->packets[i]); } pf_normalize_tcp_cleanup(cur); diff --git a/sys/netpfil/pf/pf_if.c b/sys/netpfil/pf/pf_if.c --- a/sys/netpfil/pf/pf_if.c +++ b/sys/netpfil/pf/pf_if.c @@ -256,10 +256,8 @@ for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { for (int k = 0; k < 2; k++) { - if (kif->pfik_packets[i][j][k]) - counter_u64_free(kif->pfik_packets[i][j][k]); - if (kif->pfik_bytes[i][j][k]) - counter_u64_free(kif->pfik_bytes[i][j][k]); + counter_u64_free(kif->pfik_packets[i][j][k]); + counter_u64_free(kif->pfik_bytes[i][j][k]); } } }