From 4c909f21f8a47058978214ad2f1df6a9c2d15510 Mon Sep 17 00:00:00 2001 From: Frederic Cambus Date: Wed, 27 Dec 2017 15:10:17 +0000 Subject: Add sizes for free() in the Geode LX Security Block crypto accelerator. OK visa@ --- sys/arch/i386/pci/glxsb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/i386/pci/glxsb.c b/sys/arch/i386/pci/glxsb.c index 8316b42a1b2..1f47db76948 100644 --- a/sys/arch/i386/pci/glxsb.c +++ b/sys/arch/i386/pci/glxsb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glxsb.c,v 1.33 2017/09/08 05:36:51 deraadt Exp $ */ +/* $OpenBSD: glxsb.c,v 1.34 2017/12/27 15:10:16 fcambus Exp $ */ /* * Copyright (c) 2006 Tom Cosgrove @@ -525,22 +525,22 @@ glxsb_crypto_freesession(uint64_t tid) if (swd->sw_kschedule) { explicit_bzero(swd->sw_kschedule, txf->ctxsize); - free(swd->sw_kschedule, M_CRYPTO_DATA, 0); + free(swd->sw_kschedule, M_CRYPTO_DATA, txf->ctxsize); } - free(swd, M_CRYPTO_DATA, 0); + free(swd, M_CRYPTO_DATA, sizeof(*swd)); } if ((swd = sc->sc_sessions[sesn].ses_swd_auth)) { axf = swd->sw_axf; if (swd->sw_ictx) { explicit_bzero(swd->sw_ictx, axf->ctxsize); - free(swd->sw_ictx, M_CRYPTO_DATA, 0); + free(swd->sw_ictx, M_CRYPTO_DATA, axf->ctxsize); } if (swd->sw_octx) { explicit_bzero(swd->sw_octx, axf->ctxsize); - free(swd->sw_octx, M_CRYPTO_DATA, 0); + free(swd->sw_octx, M_CRYPTO_DATA, axf->ctxsize); } - free(swd, M_CRYPTO_DATA, sizeof *swd); + free(swd, M_CRYPTO_DATA, sizeof(*swd)); } explicit_bzero(&sc->sc_sessions[sesn], sizeof(sc->sc_sessions[sesn])); return (0); -- cgit v1.2.3