Commit b184356d0a003ac5e82b4adf37f2d334df1d213c

Authored by Florian Westphal
Committed by Pablo Neira Ayuso
1 parent 197c4300ae

netfilter: conntrack: remove module owner field

No need to get/put module owner reference, none of these can be removed
anymore.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Showing 5 changed files with 0 additions and 21 deletions Side-by-side Diff

include/net/netfilter/nf_conntrack_l4proto.h
... ... @@ -74,9 +74,6 @@
74 74  
75 75 /* Return the per-net protocol part. */
76 76 struct nf_proto_net *(*get_net_proto)(struct net *net);
77   -
78   - /* Module (if any) which this is connected to. */
79   - struct module *me;
80 77 };
81 78  
82 79 bool icmp_pkt_to_tuple(const struct sk_buff *skb,
... ... @@ -148,7 +145,6 @@
148 145 const struct nf_conntrack_l4proto *__nf_ct_l4proto_find(u8 l4proto);
149 146  
150 147 const struct nf_conntrack_l4proto *nf_ct_l4proto_find_get(u8 l4proto);
151   -void nf_ct_l4proto_put(const struct nf_conntrack_l4proto *p);
152 148  
153 149 /* Protocol pernet registration. */
154 150 int nf_ct_l4proto_pernet_register_one(struct net *net,
net/netfilter/nf_conntrack_proto.c
... ... @@ -139,19 +139,11 @@
139 139  
140 140 rcu_read_lock();
141 141 p = __nf_ct_l4proto_find(l4num);
142   - if (!try_module_get(p->me))
143   - p = &nf_conntrack_l4proto_generic;
144 142 rcu_read_unlock();
145 143  
146 144 return p;
147 145 }
148 146 EXPORT_SYMBOL_GPL(nf_ct_l4proto_find_get);
149   -
150   -void nf_ct_l4proto_put(const struct nf_conntrack_l4proto *p)
151   -{
152   - module_put(p->me);
153   -}
154   -EXPORT_SYMBOL_GPL(nf_ct_l4proto_put);
155 147  
156 148 static int kill_l4proto(struct nf_conn *i, void *data)
157 149 {
net/netfilter/nf_conntrack_proto_gre.c
... ... @@ -373,7 +373,6 @@
373 373 #endif
374 374 .packet = gre_packet,
375 375 .destroy = gre_destroy,
376   - .me = THIS_MODULE,
377 376 #if IS_ENABLED(CONFIG_NF_CT_NETLINK)
378 377 .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr,
379 378 .nlattr_tuple_size = nf_ct_port_nlattr_tuple_size,
net/netfilter/nfnetlink_cttimeout.c
... ... @@ -152,7 +152,6 @@
152 152 err:
153 153 kfree(timeout);
154 154 err_proto_put:
155   - nf_ct_l4proto_put(l4proto);
156 155 return ret;
157 156 }
158 157  
... ... @@ -302,7 +301,6 @@
302 301 if (refcount_dec_if_one(&timeout->refcnt)) {
303 302 /* We are protected by nfnl mutex. */
304 303 list_del_rcu(&timeout->head);
305   - nf_ct_l4proto_put(timeout->timeout.l4proto);
306 304 nf_ct_untimeout(net, &timeout->timeout);
307 305 kfree_rcu(timeout, rcu_head);
308 306 } else {
309 307  
... ... @@ -372,10 +370,8 @@
372 370 if (ret < 0)
373 371 goto err;
374 372  
375   - nf_ct_l4proto_put(l4proto);
376 373 return 0;
377 374 err:
378   - nf_ct_l4proto_put(l4proto);
379 375 return ret;
380 376 }
381 377  
... ... @@ -511,7 +507,6 @@
511 507 /* this avoids a loop in nfnetlink. */
512 508 return ret == -EAGAIN ? -ENOBUFS : ret;
513 509 err:
514   - nf_ct_l4proto_put(l4proto);
515 510 return err;
516 511 }
517 512  
... ... @@ -592,7 +587,6 @@
592 587  
593 588 list_for_each_entry_safe(cur, tmp, &net->nfct_timeout_list, head) {
594 589 list_del_rcu(&cur->head);
595   - nf_ct_l4proto_put(cur->timeout.l4proto);
596 590  
597 591 if (refcount_dec_and_test(&cur->refcnt))
598 592 kfree_rcu(cur, rcu_head);
net/netfilter/nft_ct.c
... ... @@ -902,7 +902,6 @@
902 902 err_free_timeout:
903 903 kfree(timeout);
904 904 err_proto_put:
905   - nf_ct_l4proto_put(l4proto);
906 905 return ret;
907 906 }
908 907  
... ... @@ -913,7 +912,6 @@
913 912 struct nf_ct_timeout *timeout = priv->timeout;
914 913  
915 914 nf_ct_untimeout(ctx->net, timeout);
916   - nf_ct_l4proto_put(timeout->l4proto);
917 915 nf_ct_netns_put(ctx->net, ctx->family);
918 916 kfree(priv->timeout);
919 917 }