* [PATCH] unix: use kvmalloc_array() for BPF iterator batches
@ 2026-07-16 2:51 Weimin Xiong
2026-07-27 22:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Weimin Xiong @ 2026-07-16 2:51 UTC (permalink / raw)
To: Kuniyuki Iwashima
Cc: netdev, linux-kernel, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Weimin Xiong
Use kvmalloc_array() instead of open-coding the element-size
multiplication when allocating the Unix-domain BPF iterator batch.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
---
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index f7a9d55ee..6664ead46 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -3659,8 +3659,8 @@ static int bpf_iter_unix_realloc_batch(struct bpf_unix_iter_state *iter,
{
struct sock **new_batch;
- new_batch = kvmalloc(sizeof(*new_batch) * new_batch_sz,
- GFP_USER | __GFP_NOWARN);
+ new_batch = kvmalloc_array(new_batch_sz, sizeof(*new_batch),
+ GFP_USER | __GFP_NOWARN);
if (!new_batch)
return -ENOMEM;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] unix: use kvmalloc_array() for BPF iterator batches
2026-07-16 2:51 [PATCH] unix: use kvmalloc_array() for BPF iterator batches Weimin Xiong
@ 2026-07-27 22:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-07-27 22:40 UTC (permalink / raw)
To: Weimin Xiong
Cc: kuniyu, netdev, linux-kernel, davem, edumazet, kuba, pabeni,
horms
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:
On Thu, 16 Jul 2026 10:51:03 +0800 you wrote:
> Use kvmalloc_array() instead of open-coding the element-size
> multiplication when allocating the Unix-domain BPF iterator batch.
>
> Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
> ---
Here is the summary with links:
- unix: use kvmalloc_array() for BPF iterator batches
https://git.kernel.org/bpf/bpf-next/c/3c6e8a37eff1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-27 22:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 2:51 [PATCH] unix: use kvmalloc_array() for BPF iterator batches Weimin Xiong
2026-07-27 22:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox