aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-10-28 20:36:13 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-10-28 20:36:13 +0000
commitdcf581bb49bedcf9c18d6cccc80a9fbd68516d23 (patch)
tree8dbefbedc09c00888737db7b0b157621b838dfec /sys
parente32e1a160e01a5a0ca9e0b76ace37e58dc1379b5 (diff)
downloadsrc-dcf581bb49bedcf9c18d6cccc80a9fbd68516d23.tar.gz
src-dcf581bb49bedcf9c18d6cccc80a9fbd68516d23.zip
wg: Use zfree.
Reviewed by: kevans, markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36911
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/wg/if_wg.c6
-rw-r--r--sys/dev/wg/wg_noise.c9
2 files changed, 5 insertions, 10 deletions
diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c
index 59a8d949e8c1..07c33fb98158 100644
--- a/sys/dev/wg/if_wg.c
+++ b/sys/dev/wg/if_wg.c
@@ -2452,8 +2452,7 @@ out_locked:
sx_xunlock(&sc->sc_lock);
nvlist_destroy(nvl);
out:
- explicit_bzero(nvlpacked, wgd->wgd_size);
- free(nvlpacked, M_TEMP);
+ zfree(nvlpacked, M_TEMP);
return (err);
}
@@ -2577,8 +2576,7 @@ wgc_get(struct wg_softc *sc, struct wg_data_io *wgd)
wgd->wgd_size = size;
out:
- explicit_bzero(packed, size);
- free(packed, M_NVLIST);
+ zfree(packed, M_NVLIST);
err:
nvlist_destroy(nvl);
return (err);
diff --git a/sys/dev/wg/wg_noise.c b/sys/dev/wg/wg_noise.c
index 095da9dd4a7b..73ee712b11e9 100644
--- a/sys/dev/wg/wg_noise.c
+++ b/sys/dev/wg/wg_noise.c
@@ -223,8 +223,7 @@ noise_local_put(struct noise_local *l)
rw_destroy(&l->l_identity_lock);
mtx_destroy(&l->l_remote_mtx);
mtx_destroy(&l->l_index_mtx);
- explicit_bzero(l, sizeof(*l));
- free(l, M_NOISE);
+ zfree(l, M_NOISE);
}
}
@@ -472,8 +471,7 @@ noise_remote_smr_free(struct epoch_context *smr)
noise_local_put(r->r_local);
rw_destroy(&r->r_handshake_lock);
mtx_destroy(&r->r_keypair_mtx);
- explicit_bzero(r, sizeof(*r));
- free(r, M_NOISE);
+ zfree(r, M_NOISE);
}
void
@@ -754,8 +752,7 @@ noise_keypair_smr_free(struct epoch_context *smr)
kp = __containerof(smr, struct noise_keypair, kp_smr);
noise_remote_put(kp->kp_remote);
rw_destroy(&kp->kp_nonce_lock);
- explicit_bzero(kp, sizeof(*kp));
- free(kp, M_NOISE);
+ zfree(kp, M_NOISE);
}
void