diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2009-08-12 19:39:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-12 19:39:16 -0400 |
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) | |||
1185 | { | 1185 | { |
1186 | int err; | 1186 | int err; |
1187 | 1187 | ||
1188 | err = proto_register(&pppoe_sk_proto, 0); | 1188 | err = register_pernet_gen_device(&pppoe_net_id, &pppoe_net_ops); |
1189 | if (err) | 1189 | if (err) |
1190 | goto out; | 1190 | goto out; |
1191 | 1191 | ||
1192 | err = register_pppox_proto(PX_PROTO_OE, &pppoe_proto); | 1192 | err = proto_register(&pppoe_sk_proto, 0); |
1193 | if (err) | 1193 | if (err) |
1194 | goto out_unregister_pppoe_proto; | 1194 | goto out_unregister_net_ops; |
1195 | 1195 | ||
1196 | err = register_pernet_gen_device(&pppoe_net_id, &pppoe_net_ops); | 1196 | err = register_pppox_proto(PX_PROTO_OE, &pppoe_proto); |
1197 | if (err) | 1197 | if (err) |
1198 | goto out_unregister_pppox_proto; | 1198 | goto out_unregister_pppoe_proto; |
1199 | 1199 | ||
1200 | dev_add_pack(&pppoes_ptype); | 1200 | dev_add_pack(&pppoes_ptype); |
1201 | dev_add_pack(&pppoed_ptype); | 1201 | dev_add_pack(&pppoed_ptype); |
@@ -1203,22 +1203,22 @@ static int __init pppoe_init(void) | |||
1203 | 1203 | ||
1204 | return 0; | 1204 | return 0; |
1205 | 1205 | ||
1206 | out_unregister_pppox_proto: | ||
1207 | unregister_pppox_proto(PX_PROTO_OE); | ||
1208 | out_unregister_pppoe_proto: | 1206 | out_unregister_pppoe_proto: |
1209 | proto_unregister(&pppoe_sk_proto); | 1207 | proto_unregister(&pppoe_sk_proto); |
1208 | out_unregister_net_ops: | ||
1209 | unregister_pernet_gen_device(pppoe_net_id, &pppoe_net_ops); | ||
1210 | out: | 1210 | out: |
1211 | return err; | 1211 | return err; |
1212 | } | 1212 | } |
1213 | 1213 | ||
1214 | static void __exit pppoe_exit(void) | 1214 | static void __exit pppoe_exit(void) |
1215 | { | 1215 | { |
1216 | unregister_pppox_proto(PX_PROTO_OE); | ||
1217 | dev_remove_pack(&pppoes_ptype); | ||
1218 | dev_remove_pack(&pppoed_ptype); | ||
1219 | unregister_netdevice_notifier(&pppoe_notifier); | 1216 | unregister_netdevice_notifier(&pppoe_notifier); |
1220 | unregister_pernet_gen_device(pppoe_net_id, &pppoe_net_ops); | 1217 | dev_remove_pack(&pppoed_ptype); |
1218 | dev_remove_pack(&pppoes_ptype); | ||
1219 | unregister_pppox_proto(PX_PROTO_OE); | ||
1221 | proto_unregister(&pppoe_sk_proto); | 1220 | proto_unregister(&pppoe_sk_proto); |
1221 | unregister_pernet_gen_device(pppoe_net_id, &pppoe_net_ops); | ||
1222 | } | 1222 | } |
1223 | 1223 | ||
1224 | module_init(pppoe_init); | 1224 | module_init(pppoe_init); |