diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/crypto/crypto.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/sys/crypto/crypto.c b/sys/crypto/crypto.c index 0f98c014370..de2840a1ed3 100644 --- a/sys/crypto/crypto.c +++ b/sys/crypto/crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.c,v 1.71 2014/10/23 00:11:48 dlg Exp $ */ +/* $OpenBSD: crypto.c,v 1.72 2014/10/23 00:15:09 dlg Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -453,20 +453,16 @@ void crypto_freereq(struct cryptop *crp) { struct cryptodesc *crd; - int s; if (crp == NULL) return; - s = splvm(); - while ((crd = crp->crp_desc) != NULL) { crp->crp_desc = crd->crd_next; pool_put(&cryptodesc_pool, crd); } pool_put(&cryptop_pool, crp); - splx(s); } /* @@ -477,20 +473,14 @@ crypto_getreq(int num) { struct cryptodesc *crd; struct cryptop *crp; - int s; - s = splvm(); - crp = pool_get(&cryptop_pool, PR_NOWAIT | PR_ZERO); - if (crp == NULL) { - splx(s); + if (crp == NULL) return NULL; - } while (num--) { crd = pool_get(&cryptodesc_pool, PR_NOWAIT | PR_ZERO); if (crd == NULL) { - splx(s); crypto_freereq(crp); return NULL; } @@ -499,7 +489,6 @@ crypto_getreq(int num) crp->crp_desc = crd; } - splx(s); return crp; } @@ -510,8 +499,10 @@ crypto_init(void) pool_init(&cryptop_pool, sizeof(struct cryptop), 0, 0, 0, "cryptop", NULL); + pool_setipl(&cryptop_pool, IPL_VM); pool_init(&cryptodesc_pool, sizeof(struct cryptodesc), 0, 0, 0, "cryptodesc", NULL); + pool_setipl(&cryptodesc_pool, IPL_VM); } /* |