diff --git a/sys/crypto/armv8/armv8_crypto.c b/sys/crypto/armv8/armv8_crypto.c index bc3e70f935b5..9975a2782229 100644 --- a/sys/crypto/armv8/armv8_crypto.c +++ b/sys/crypto/armv8/armv8_crypto.c @@ -357,10 +357,8 @@ armv8_crypto_cipher_process(struct armv8_crypto_session *ses, fpu_kern_leave(curthread, ctx); RELEASE_CTX(i, ctx); } - if (allocated) { - bzero(buf, crp->crp_payload_length); - free(buf, M_ARMV8_CRYPTO); - } + if (allocated) + zfree(buf, M_ARMV8_CRYPTO); return (0); } diff --git a/sys/crypto/via/padlock_hash.c b/sys/crypto/via/padlock_hash.c index c1bfce6135dc..1640bad4ea74 100644 --- a/sys/crypto/via/padlock_hash.c +++ b/sys/crypto/via/padlock_hash.c @@ -199,8 +199,7 @@ padlock_sha_free(void *vctx) ctx = vctx; if (ctx->psc_buf != NULL) { - //bzero(ctx->psc_buf, ctx->psc_size); - free(ctx->psc_buf, M_PADLOCK); + zfree(ctx->psc_buf, M_PADLOCK); ctx->psc_buf = NULL; ctx->psc_offset = 0; ctx->psc_size = 0; @@ -415,14 +414,12 @@ padlock_hash_free(struct padlock_session *ses) if (ses->ses_ictx != NULL) { padlock_free_ctx(ses->ses_axf, ses->ses_ictx); - bzero(ses->ses_ictx, ses->ses_axf->ctxsize); - free(ses->ses_ictx, M_PADLOCK); + zfree(ses->ses_ictx, M_PADLOCK); ses->ses_ictx = NULL; } if (ses->ses_octx != NULL) { padlock_free_ctx(ses->ses_axf, ses->ses_octx); - bzero(ses->ses_octx, ses->ses_axf->ctxsize); - free(ses->ses_octx, M_PADLOCK); + zfree(ses->ses_octx, M_PADLOCK); ses->ses_octx = NULL; } } diff --git a/sys/dev/glxsb/glxsb_hash.c b/sys/dev/glxsb/glxsb_hash.c index cae1c1980114..9fe73c88a7c6 100644 --- a/sys/dev/glxsb/glxsb_hash.c +++ b/sys/dev/glxsb/glxsb_hash.c @@ -145,13 +145,11 @@ glxsb_hash_free(struct glxsb_session *ses) { if (ses->ses_ictx != NULL) { - bzero(ses->ses_ictx, ses->ses_axf->ctxsize); - free(ses->ses_ictx, M_GLXSB); + zfree(ses->ses_ictx, M_GLXSB); ses->ses_ictx = NULL; } if (ses->ses_octx != NULL) { - bzero(ses->ses_octx, ses->ses_axf->ctxsize); - free(ses->ses_octx, M_GLXSB); + zfree(ses->ses_octx, M_GLXSB); ses->ses_octx = NULL; } } diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index 52082294b4e3..dbfb16c27d04 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -1005,8 +1005,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, g_destroy_consumer(cp); g_destroy_geom(gp); g_eli_key_destroy(sc); - bzero(sc, sizeof(*sc)); - free(sc, M_ELI); + zfree(sc, M_ELI); return (NULL); } @@ -1049,8 +1048,7 @@ g_eli_destroy(struct g_eli_softc *sc, boolean_t force) mtx_destroy(&sc->sc_queue_mtx); gp->softc = NULL; g_eli_key_destroy(sc); - bzero(sc, sizeof(*sc)); - free(sc, M_ELI); + zfree(sc, M_ELI); G_ELI_DEBUG(0, "Device %s destroyed.", gp->name); g_wither_geom_close(gp, ENXIO);