Netdev List
 help / color / mirror / Atom feed
* [PATCH RESEND 1/6] sock: add sock_kzalloc helper
@ 2026-05-27  8:25 Thorsten Blum
  2026-05-27  8:25 ` [PATCH RESEND 2/6] crypto: af_alg - use sock_kzalloc in af_alg_alloc_areq Thorsten Blum
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Thorsten Blum @ 2026-05-27  8:25 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, Eric Dumazet, Kuniyuki Iwashima,
	Paolo Abeni, Willem de Bruijn, Jakub Kicinski, Simon Horman
  Cc: linux-crypto, linux-kernel, netdev, Thorsten Blum

Add sock_kzalloc() helper - the sock equivalent to kzalloc().

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
Patch 1/6 needs an Acked-by: from netdev maintainers for the series to
go through Herbert's crypto tree:
https://lore.kernel.org/lkml/ahVkZOxZtFes6Huf@gondor.apana.org.au/
---
 include/net/sock.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/net/sock.h b/include/net/sock.h
index 76bfd3e56d63..b521bd34ac9f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1913,6 +1913,11 @@ void sock_kfree_s(struct sock *sk, void *mem, int size);
 void sock_kzfree_s(struct sock *sk, void *mem, int size);
 void sk_send_sigurg(struct sock *sk);
 
+static inline void *sock_kzalloc(struct sock *sk, int size, gfp_t priority)
+{
+	return sock_kmalloc(sk, size, priority | __GFP_ZERO);
+}
+
 static inline void sock_replace_proto(struct sock *sk, struct proto *proto)
 {
 	if (sk->sk_socket)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-27  8:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27  8:25 [PATCH RESEND 1/6] sock: add sock_kzalloc helper Thorsten Blum
2026-05-27  8:25 ` [PATCH RESEND 2/6] crypto: af_alg - use sock_kzalloc in af_alg_alloc_areq Thorsten Blum
2026-05-27  8:25 ` [PATCH RESEND 3/6] crypto: algif_aead - use sock_kzalloc in aead_accept_parent_nokey Thorsten Blum
2026-05-27  8:25 ` [PATCH RESEND 4/6] crypto: af_alg - use sock_kzalloc in alloc_result + accept_parent_nokey Thorsten Blum
2026-05-27  8:25 ` [PATCH RESEND 5/6] crypto: algif_rng - use sock_kzalloc in rng_accept_parent Thorsten Blum
2026-05-27  8:25 ` [PATCH RESEND 6/6] crypto: algif_skcipher - use sock_kzalloc in accept_parent_nokey Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox