net: Use umd_cleanup_helper()
authorJarkko Sakkinen <jarkko@kernel.org>
Fri, 26 May 2023 11:21:02 +0000 (14:21 +0300)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 31 May 2023 11:06:57 +0000 (13:06 +0200)
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
include/linux/bpfilter.h
net/bpfilter/bpfilter_kern.c
net/ipv4/bpfilter/sockopt.c

index 2ae3c8e..736ded4 100644 (file)
@@ -11,7 +11,6 @@ int bpfilter_ip_set_sockopt(struct sock *sk, int optname, sockptr_t optval,
                            unsigned int optlen);
 int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char __user *optval,
                            int __user *optlen);
-void bpfilter_umh_cleanup(struct umd_info *info);
 
 struct bpfilter_umh_ops {
        struct umd_info info;
index 422ec6e..97e129e 100644 (file)
@@ -21,7 +21,7 @@ static void shutdown_umh(void)
        if (tgid) {
                kill_pid(tgid, SIGKILL, 1);
                wait_event(tgid->wait_pidfd, thread_group_exited(tgid));
-               bpfilter_umh_cleanup(info);
+               umd_cleanup_helper(info);
        }
 }
 
index 1b34cb9..193bcc2 100644 (file)
 struct bpfilter_umh_ops bpfilter_ops;
 EXPORT_SYMBOL_GPL(bpfilter_ops);
 
-void bpfilter_umh_cleanup(struct umd_info *info)
-{
-       fput(info->pipe_to_umh);
-       fput(info->pipe_from_umh);
-       put_pid(info->tgid);
-       info->tgid = NULL;
-}
-EXPORT_SYMBOL_GPL(bpfilter_umh_cleanup);
-
 static int bpfilter_mbox_request(struct sock *sk, int optname, sockptr_t optval,
                                 unsigned int optlen, bool is_set)
 {
@@ -38,7 +29,7 @@ static int bpfilter_mbox_request(struct sock *sk, int optname, sockptr_t optval,
        }
        if (bpfilter_ops.info.tgid &&
            thread_group_exited(bpfilter_ops.info.tgid))
-               bpfilter_umh_cleanup(&bpfilter_ops.info);
+               umd_cleanup_helper(&bpfilter_ops.info);
 
        if (!bpfilter_ops.info.tgid) {
                err = bpfilter_ops.start();