]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
l2tp: return void from l2tp_session_delete
authorTom Parkin <tparkin@katalix.com>
Tue, 28 Jul 2020 17:20:30 +0000 (18:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Jul 2020 23:45:31 +0000 (16:45 -0700)
l2tp_session_delete is used to schedule a session instance for deletion.
The function itself always returns zero, and none of its direct callers
check its return value, so have the function return void.

This change de-facto changes the l2tp netlink session_delete callback
prototype since all pseudowires currently use l2tp_session_delete for
their implementation of that operation.

Signed-off-by: Tom Parkin <tparkin@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_core.c
net/l2tp/l2tp_core.h
net/l2tp/l2tp_netlink.c

index f22fe34eb8fc2c1ba2aeb2ca5d98d4c802c809d9..690dcbc30472a34b307d6879f98a12363b8aa1f8 100644 (file)
@@ -1620,13 +1620,10 @@ void l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
 }
 EXPORT_SYMBOL_GPL(l2tp_tunnel_delete);
 
-/* This function is used by the netlink SESSION_DELETE command and by
- * pseudowire modules.
- */
-int l2tp_session_delete(struct l2tp_session *session)
+void l2tp_session_delete(struct l2tp_session *session)
 {
        if (test_and_set_bit(0, &session->dead))
-               return 0;
+               return;
 
        l2tp_session_unhash(session);
        l2tp_session_queue_purge(session);
@@ -1634,8 +1631,6 @@ int l2tp_session_delete(struct l2tp_session *session)
                (*session->session_close)(session);
 
        l2tp_session_dec_refcount(session);
-
-       return 0;
 }
 EXPORT_SYMBOL_GPL(l2tp_session_delete);
 
index 5c49e27623007fa5cdf95123daa2412db8a53e9b..0c32981f0cd3cb903b9d45a2eaa7183dd0362a88 100644 (file)
@@ -167,7 +167,7 @@ struct l2tp_nl_cmd_ops {
        int (*session_create)(struct net *net, struct l2tp_tunnel *tunnel,
                              u32 session_id, u32 peer_session_id,
                              struct l2tp_session_cfg *cfg);
-       int (*session_delete)(struct l2tp_session *session);
+       void (*session_delete)(struct l2tp_session *session);
 };
 
 static inline void *l2tp_session_priv(struct l2tp_session *session)
@@ -204,7 +204,7 @@ struct l2tp_session *l2tp_session_create(int priv_size,
 int l2tp_session_register(struct l2tp_session *session,
                          struct l2tp_tunnel *tunnel);
 
-int l2tp_session_delete(struct l2tp_session *session);
+void l2tp_session_delete(struct l2tp_session *session);
 void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
                      unsigned char *ptr, unsigned char *optr, u16 hdrflags,
                      int length);
index 35716a6e1e2c1a68ae57eef2a4ea48157e607cbc..def78eebca4c5dd1e044f783ec9dad2b98161ca1 100644 (file)
@@ -670,7 +670,7 @@ static int l2tp_nl_cmd_session_delete(struct sk_buff *skb, struct genl_info *inf
        pw_type = session->pwtype;
        if (pw_type < __L2TP_PWTYPE_MAX)
                if (l2tp_nl_cmd_ops[pw_type] && l2tp_nl_cmd_ops[pw_type]->session_delete)
-                       ret = (*l2tp_nl_cmd_ops[pw_type]->session_delete)(session);
+                       l2tp_nl_cmd_ops[pw_type]->session_delete(session);
 
        l2tp_session_dec_refcount(session);