diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2009-08-12 16:39:16 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-12 16:39:16 -0700 |
commit | 07f6642ee9418e962e54cbc07471cfe2e559c568 (patch) | |
tree | d91644c131130086be22b82a07979dcc85ea8ac9 /drivers/net/pppoe.c | |
parent | bbd8a0d3a3b65d341437f8b99c828fa5cc29c739 (diff) |
net,pppoe: fixup module init/exit subsequent calls
pernet data should allocated first and freed last
on module init/exit routines otherwise it's possible
to have unserialized calls to packet handling routines.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pppoe.c')
-rw-r--r-- | drivers/net/pppoe.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 5f2090233d7b..7cbf6f9b51de 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c @@ -1185,17 +1185,17 @@ static int __init pppoe_init(void) { int err; - err = proto_register(&pppoe_sk_proto, 0); + err = register_pernet_gen_device(&pppoe_net_id, &pppoe_net_ops); if (err) goto out; - err = register_pppox_proto(PX_PROTO_OE, &pppoe_proto); + err = proto_register(&pppoe_sk_proto, 0); if (err) - goto out_unregister_pppoe_proto; + goto out_unregister_net_ops; - err = register_pernet_gen_device(&pppoe_net_id, &pppoe_net_ops); + err = register_pppox_proto(PX_PROTO_OE, &pppoe_proto); if (err) - goto out_unregister_pppox_proto; + goto out_unregister_pppoe_proto; dev_add_pack(&pppoes_ptype); dev_add_pack(&pppoed_ptype); @@ -1203,22 +1203,22 @@ static int __init pppoe_init(void) return 0; -out_unregister_pppox_proto: - unregister_pppox_proto(PX_PROTO_OE); out_unregister_pppoe_proto: proto_unregister(&pppoe_sk_proto); +out_unregister_net_ops: + unregister_pernet_gen_device(pppoe_net_id, &pppoe_net_ops); out: return err; } static void __exit pppoe_exit(void) { - unregister_pppox_proto(PX_PROTO_OE); - dev_remove_pack(&pppoes_ptype); - dev_remove_pack(&pppoed_ptype); unregister_netdevice_notifier(&pppoe_notifier); - unregister_pernet_gen_device(pppoe_net_id, &pppoe_net_ops); + dev_remove_pack(&pppoed_ptype); + dev_remove_pack(&pppoes_ptype); + unregister_pppox_proto(PX_PROTO_OE); proto_unregister(&pppoe_sk_proto); + unregister_pernet_gen_device(pppoe_net_id, &pppoe_net_ops); } module_init(pppoe_init); |