[TWSK]: Grab the module refcount for timewait sockets
This is required to avoid unloading a module that has active timewait sockets, such as DCCP. Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
2a9bc9bb4d
commit
eeb2b85606
@@ -111,6 +111,7 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int stat
|
||||
tw->tw_prot = sk->sk_prot_creator;
|
||||
atomic_set(&tw->tw_refcnt, 1);
|
||||
inet_twsk_dead_node_init(tw);
|
||||
__module_get(tw->tw_prot->owner);
|
||||
}
|
||||
|
||||
return tw;
|
||||
|
Reference in New Issue
Block a user