[PATCH RESEND 2/6] crypto: af_alg - use sock_kzalloc in af_alg_alloc_areq
From: Thorsten Blum
Date: Wed May 27 2026 - 04:27:08 EST
Replace sock_kmalloc() followed by memset(0) with sock_kzalloc() to
simplify af_alg_alloc_areq().
Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
---
crypto/af_alg.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 48c53f488e0f..9438a874c1f1 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -1158,12 +1158,10 @@ struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk,
if (ctx->inflight)
return ERR_PTR(-EBUSY);
- areq = sock_kmalloc(sk, areqlen, GFP_KERNEL);
+ areq = sock_kzalloc(sk, areqlen, GFP_KERNEL);
if (unlikely(!areq))
return ERR_PTR(-ENOMEM);
- memset(areq, 0, areqlen);
-
ctx->inflight = true;
areq->areqlen = areqlen;