mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
2a9bc9bb4d
commit
eeb2b85606
2 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue