git: 517547573a5b - main - crypto: move all zeroing into crypto_getreq

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Tue, 22 Nov 2022 12:29:10 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=517547573a5bcf28c676daca3a9118fcd28c8116

commit 517547573a5bcf28c676daca3a9118fcd28c8116
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-11-22 12:28:07 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-11-22 12:28:07 +0000

    crypto: move all zeroing into crypto_getreq
    
    Reviewed by:    jhb, markj
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D36774
---
 sys/opencrypto/crypto.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
index 25bbc9a4bf70..0baa61c089d3 100644
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -1633,17 +1633,11 @@ crypto_freereq(struct cryptop *crp)
 	uma_zfree(cryptop_zone, crp);
 }
 
-static void
-_crypto_initreq(struct cryptop *crp, crypto_session_t cses)
-{
-	crp->crp_session = cses;
-}
-
 void
 crypto_initreq(struct cryptop *crp, crypto_session_t cses)
 {
 	memset(crp, 0, sizeof(*crp));
-	_crypto_initreq(crp, cses);
+	crp->crp_session = cses;
 }
 
 struct cryptop *
@@ -1652,9 +1646,9 @@ crypto_getreq(crypto_session_t cses, int how)
 	struct cryptop *crp;
 
 	MPASS(how == M_WAITOK || how == M_NOWAIT);
-	crp = uma_zalloc(cryptop_zone, how | M_ZERO);
+	crp = uma_zalloc(cryptop_zone, how);
 	if (crp != NULL)
-		_crypto_initreq(crp, cses);
+		crypto_initreq(crp, cses);
 	return (crp);
 }