diff options
Diffstat (limited to 'net/ipv4/inet_timewait_sock.c')
-rw-r--r-- | net/ipv4/inet_timewait_sock.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 8554d0ea1719..68a8d892c711 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
@@ -49,19 +49,22 @@ static void __inet_twsk_kill(struct inet_timewait_sock *tw, | |||
49 | inet_twsk_put(tw); | 49 | inet_twsk_put(tw); |
50 | } | 50 | } |
51 | 51 | ||
52 | void inet_twsk_put(struct inet_timewait_sock *tw) | 52 | static noinline void inet_twsk_free(struct inet_timewait_sock *tw) |
53 | { | 53 | { |
54 | if (atomic_dec_and_test(&tw->tw_refcnt)) { | 54 | struct module *owner = tw->tw_prot->owner; |
55 | struct module *owner = tw->tw_prot->owner; | 55 | twsk_destructor((struct sock *)tw); |
56 | twsk_destructor((struct sock *)tw); | ||
57 | #ifdef SOCK_REFCNT_DEBUG | 56 | #ifdef SOCK_REFCNT_DEBUG |
58 | printk(KERN_DEBUG "%s timewait_sock %p released\n", | 57 | pr_debug("%s timewait_sock %p released\n", tw->tw_prot->name, tw); |
59 | tw->tw_prot->name, tw); | ||
60 | #endif | 58 | #endif |
61 | release_net(twsk_net(tw)); | 59 | release_net(twsk_net(tw)); |
62 | kmem_cache_free(tw->tw_prot->twsk_prot->twsk_slab, tw); | 60 | kmem_cache_free(tw->tw_prot->twsk_prot->twsk_slab, tw); |
63 | module_put(owner); | 61 | module_put(owner); |
64 | } | 62 | } |
63 | |||
64 | void inet_twsk_put(struct inet_timewait_sock *tw) | ||
65 | { | ||
66 | if (atomic_dec_and_test(&tw->tw_refcnt)) | ||
67 | inet_twsk_free(tw); | ||
65 | } | 68 | } |
66 | EXPORT_SYMBOL_GPL(inet_twsk_put); | 69 | EXPORT_SYMBOL_GPL(inet_twsk_put); |
67 | 70 | ||