Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: Use umd_cleanup_helper()

bpfilter_umh_cleanup() is the same function as umd_cleanup_helper().
Drop the redundant function.

Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230526112104.1044686-1-jarkko@kernel.org

authored by

Jarkko Sakkinen and committed by
Daniel Borkmann
9b68f30b ffadc372

+2 -12
-1
include/linux/bpfilter.h
··· 11 11 unsigned int optlen); 12 12 int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char __user *optval, 13 13 int __user *optlen); 14 - void bpfilter_umh_cleanup(struct umd_info *info); 15 14 16 15 struct bpfilter_umh_ops { 17 16 struct umd_info info;
+1 -1
net/bpfilter/bpfilter_kern.c
··· 21 21 if (tgid) { 22 22 kill_pid(tgid, SIGKILL, 1); 23 23 wait_event(tgid->wait_pidfd, thread_group_exited(tgid)); 24 - bpfilter_umh_cleanup(info); 24 + umd_cleanup_helper(info); 25 25 } 26 26 } 27 27
+1 -10
net/ipv4/bpfilter/sockopt.c
··· 12 12 struct bpfilter_umh_ops bpfilter_ops; 13 13 EXPORT_SYMBOL_GPL(bpfilter_ops); 14 14 15 - void bpfilter_umh_cleanup(struct umd_info *info) 16 - { 17 - fput(info->pipe_to_umh); 18 - fput(info->pipe_from_umh); 19 - put_pid(info->tgid); 20 - info->tgid = NULL; 21 - } 22 - EXPORT_SYMBOL_GPL(bpfilter_umh_cleanup); 23 - 24 15 static int bpfilter_mbox_request(struct sock *sk, int optname, sockptr_t optval, 25 16 unsigned int optlen, bool is_set) 26 17 { ··· 29 38 } 30 39 if (bpfilter_ops.info.tgid && 31 40 thread_group_exited(bpfilter_ops.info.tgid)) 32 - bpfilter_umh_cleanup(&bpfilter_ops.info); 41 + umd_cleanup_helper(&bpfilter_ops.info); 33 42 34 43 if (!bpfilter_ops.info.tgid) { 35 44 err = bpfilter_ops.start();