Use zfree() instead of bzero() and free().
These bzero's should have been explicit_bzero's. Reviewed by: cem, delphij Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D25437
This commit is contained in:
parent
17a831ea25
commit
b172f23dd7
@ -357,10 +357,8 @@ armv8_crypto_cipher_process(struct armv8_crypto_session *ses,
|
|||||||
fpu_kern_leave(curthread, ctx);
|
fpu_kern_leave(curthread, ctx);
|
||||||
RELEASE_CTX(i, ctx);
|
RELEASE_CTX(i, ctx);
|
||||||
}
|
}
|
||||||
if (allocated) {
|
if (allocated)
|
||||||
bzero(buf, crp->crp_payload_length);
|
zfree(buf, M_ARMV8_CRYPTO);
|
||||||
free(buf, M_ARMV8_CRYPTO);
|
|
||||||
}
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,8 +199,7 @@ padlock_sha_free(void *vctx)
|
|||||||
|
|
||||||
ctx = vctx;
|
ctx = vctx;
|
||||||
if (ctx->psc_buf != NULL) {
|
if (ctx->psc_buf != NULL) {
|
||||||
//bzero(ctx->psc_buf, ctx->psc_size);
|
zfree(ctx->psc_buf, M_PADLOCK);
|
||||||
free(ctx->psc_buf, M_PADLOCK);
|
|
||||||
ctx->psc_buf = NULL;
|
ctx->psc_buf = NULL;
|
||||||
ctx->psc_offset = 0;
|
ctx->psc_offset = 0;
|
||||||
ctx->psc_size = 0;
|
ctx->psc_size = 0;
|
||||||
@ -415,14 +414,12 @@ padlock_hash_free(struct padlock_session *ses)
|
|||||||
|
|
||||||
if (ses->ses_ictx != NULL) {
|
if (ses->ses_ictx != NULL) {
|
||||||
padlock_free_ctx(ses->ses_axf, ses->ses_ictx);
|
padlock_free_ctx(ses->ses_axf, ses->ses_ictx);
|
||||||
bzero(ses->ses_ictx, ses->ses_axf->ctxsize);
|
zfree(ses->ses_ictx, M_PADLOCK);
|
||||||
free(ses->ses_ictx, M_PADLOCK);
|
|
||||||
ses->ses_ictx = NULL;
|
ses->ses_ictx = NULL;
|
||||||
}
|
}
|
||||||
if (ses->ses_octx != NULL) {
|
if (ses->ses_octx != NULL) {
|
||||||
padlock_free_ctx(ses->ses_axf, ses->ses_octx);
|
padlock_free_ctx(ses->ses_axf, ses->ses_octx);
|
||||||
bzero(ses->ses_octx, ses->ses_axf->ctxsize);
|
zfree(ses->ses_octx, M_PADLOCK);
|
||||||
free(ses->ses_octx, M_PADLOCK);
|
|
||||||
ses->ses_octx = NULL;
|
ses->ses_octx = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,13 +145,11 @@ glxsb_hash_free(struct glxsb_session *ses)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (ses->ses_ictx != NULL) {
|
if (ses->ses_ictx != NULL) {
|
||||||
bzero(ses->ses_ictx, ses->ses_axf->ctxsize);
|
zfree(ses->ses_ictx, M_GLXSB);
|
||||||
free(ses->ses_ictx, M_GLXSB);
|
|
||||||
ses->ses_ictx = NULL;
|
ses->ses_ictx = NULL;
|
||||||
}
|
}
|
||||||
if (ses->ses_octx != NULL) {
|
if (ses->ses_octx != NULL) {
|
||||||
bzero(ses->ses_octx, ses->ses_axf->ctxsize);
|
zfree(ses->ses_octx, M_GLXSB);
|
||||||
free(ses->ses_octx, M_GLXSB);
|
|
||||||
ses->ses_octx = NULL;
|
ses->ses_octx = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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_consumer(cp);
|
||||||
g_destroy_geom(gp);
|
g_destroy_geom(gp);
|
||||||
g_eli_key_destroy(sc);
|
g_eli_key_destroy(sc);
|
||||||
bzero(sc, sizeof(*sc));
|
zfree(sc, M_ELI);
|
||||||
free(sc, M_ELI);
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1049,8 +1048,7 @@ g_eli_destroy(struct g_eli_softc *sc, boolean_t force)
|
|||||||
mtx_destroy(&sc->sc_queue_mtx);
|
mtx_destroy(&sc->sc_queue_mtx);
|
||||||
gp->softc = NULL;
|
gp->softc = NULL;
|
||||||
g_eli_key_destroy(sc);
|
g_eli_key_destroy(sc);
|
||||||
bzero(sc, sizeof(*sc));
|
zfree(sc, M_ELI);
|
||||||
free(sc, M_ELI);
|
|
||||||
|
|
||||||
G_ELI_DEBUG(0, "Device %s destroyed.", gp->name);
|
G_ELI_DEBUG(0, "Device %s destroyed.", gp->name);
|
||||||
g_wither_geom_close(gp, ENXIO);
|
g_wither_geom_close(gp, ENXIO);
|
||||||
|
Loading…
Reference in New Issue
Block a user