[PATCH 2/6] crypto: af_alg - use sock_kzalloc in af_alg_alloc_areq

Thorsten Blum
2026-04-27T10:43:53Z

simplify af_alg_alloc_areq().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
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 5a00c18eb145..7a853a866957 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -1179,12 +1179,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;