mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
[NET]: Marking struct pernet_operations __net_initdata was inappropriate
It is not safe to to place struct pernet_operations in a special section. We need struct pernet_operations to last until we call unregister_pernet_subsys. Which doesn't happen until module unload. So marking struct pernet_operations is a disaster for modules in two ways. - We discard it before we call the exit method it points to. - Because I keep struct pernet_operations on a linked list discarding it for compiled in code removes elements in the middle of a linked list and does horrible things for linked insert. So this looks safe assuming __exit_refok is not discarded for modules. Signed-off-by: Eric W. Biederman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
72998d8c84
commit
2b008b0a8e
6 changed files with 7 additions and 9 deletions
|
|
@ -185,7 +185,7 @@ static __net_exit void proc_net_ns_exit(struct net *net)
|
|||
kfree(net->proc_net_root);
|
||||
}
|
||||
|
||||
static struct pernet_operations __net_initdata proc_net_ns_ops = {
|
||||
static struct pernet_operations proc_net_ns_ops = {
|
||||
.init = proc_net_ns_init,
|
||||
.exit = proc_net_ns_exit,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue