Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Nov 2022 12:29:10 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 517547573a5b - main - crypto: move all zeroing into crypto_getreq
Message-ID:  <202211221229.2AMCTA71000082@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202211221229.2AMCTA71000082>