summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2017-12-24 16:19:28 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2017-12-24 16:19:28 +0000
commit666f490c24ecec27ed89ad934923c7a74099a09b (patch)
treeb878eb18a947a9f13eea3b20816a3d33fe01a50c /sys/arch/amd64
parenta41077d7835e4740f073af57bb948aa525dba99f (diff)
Somes fixes for the VIA PadLock drivers.
- Do not ignore the return value of m_copyback() on i386 - Always free sc->op_buf before returning on both amd64 and i386, pointed out by mikeb@, thanks! OK mikeb@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/via.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/via.c b/sys/arch/amd64/amd64/via.c
index d65eb5a3747..c0e1e540b12 100644
--- a/sys/arch/amd64/amd64/via.c
+++ b/sys/arch/amd64/amd64/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.25 2017/11/14 13:09:22 fcambus Exp $ */
+/* $OpenBSD: via.c,v 1.26 2017/12/24 16:19:27 fcambus Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -366,7 +366,7 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
memcpy(crp->crp_buf + crd->crd_inject,
sc->op_iv, 16);
if (err)
- return (err);
+ goto errout;
}
} else {
sc->op_cw[0] = ses->ses_cw0 | C3_CRYPT_CWLO_DECRYPT;
@@ -409,6 +409,7 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
memcpy(crp->crp_buf + crd->crd_skip, sc->op_buf,
crd->crd_len);
+ errout:
if (sc->op_buf != NULL) {
explicit_bzero(sc->op_buf, crd->crd_len);
free(sc->op_buf, M_DEVBUF, crd->crd_len);