summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2018-06-01 18:39:49 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2018-06-01 18:39:49 +0000
commit7090103d2019e2cdb73108be17fcf02fc72e846c (patch)
treebc268d554af6b936b6c6b2cfa7ac42e3901a7159 /sys
parent28d5680d1392837144b6507c6e5110ee8a8e47d4 (diff)
Clear aesni_sc if the context is freed, to avoid leaving a dangling
pointer behind. OK visa@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/aesni.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/aesni.c b/sys/arch/amd64/amd64/aesni.c
index 85824c479c8..de2d32347aa 100644
--- a/sys/arch/amd64/amd64/aesni.c
+++ b/sys/arch/amd64/amd64/aesni.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aesni.c,v 1.46 2018/04/24 02:53:44 visa Exp $ */
+/* $OpenBSD: aesni.c,v 1.47 2018/06/01 18:39:48 fcambus Exp $ */
/*-
* Copyright (c) 2003 Jason Wright
* Copyright (c) 2003, 2004 Theo de Raadt
@@ -157,6 +157,7 @@ aesni_setup(void)
aesni_sc->sc_cid = crypto_get_driverid(CRYPTOCAP_F_MPSAFE);
if (aesni_sc->sc_cid < 0) {
free(aesni_sc, M_DEVBUF, sizeof(*aesni_sc));
+ aesni_sc = NULL;
return;
}