diff options
| -rw-r--r-- | net/key/af_key.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c index 76fa6fef6473..539f43bc97db 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
| @@ -3794,9 +3794,9 @@ static struct pernet_operations pfkey_net_ops = { | |||
| 3794 | 3794 | ||
| 3795 | static void __exit ipsec_pfkey_exit(void) | 3795 | static void __exit ipsec_pfkey_exit(void) |
| 3796 | { | 3796 | { |
| 3797 | unregister_pernet_subsys(&pfkey_net_ops); | ||
| 3798 | xfrm_unregister_km(&pfkeyv2_mgr); | 3797 | xfrm_unregister_km(&pfkeyv2_mgr); |
| 3799 | sock_unregister(PF_KEY); | 3798 | sock_unregister(PF_KEY); |
| 3799 | unregister_pernet_subsys(&pfkey_net_ops); | ||
| 3800 | proto_unregister(&key_proto); | 3800 | proto_unregister(&key_proto); |
| 3801 | } | 3801 | } |
| 3802 | 3802 | ||
| @@ -3807,21 +3807,22 @@ static int __init ipsec_pfkey_init(void) | |||
| 3807 | if (err != 0) | 3807 | if (err != 0) |
| 3808 | goto out; | 3808 | goto out; |
| 3809 | 3809 | ||
| 3810 | err = sock_register(&pfkey_family_ops); | 3810 | err = register_pernet_subsys(&pfkey_net_ops); |
| 3811 | if (err != 0) | 3811 | if (err != 0) |
| 3812 | goto out_unregister_key_proto; | 3812 | goto out_unregister_key_proto; |
| 3813 | err = sock_register(&pfkey_family_ops); | ||
| 3814 | if (err != 0) | ||
| 3815 | goto out_unregister_pernet; | ||
| 3813 | err = xfrm_register_km(&pfkeyv2_mgr); | 3816 | err = xfrm_register_km(&pfkeyv2_mgr); |
| 3814 | if (err != 0) | 3817 | if (err != 0) |
| 3815 | goto out_sock_unregister; | 3818 | goto out_sock_unregister; |
| 3816 | err = register_pernet_subsys(&pfkey_net_ops); | ||
| 3817 | if (err != 0) | ||
| 3818 | goto out_xfrm_unregister_km; | ||
| 3819 | out: | 3819 | out: |
| 3820 | return err; | 3820 | return err; |
| 3821 | out_xfrm_unregister_km: | 3821 | |
| 3822 | xfrm_unregister_km(&pfkeyv2_mgr); | ||
| 3823 | out_sock_unregister: | 3822 | out_sock_unregister: |
| 3824 | sock_unregister(PF_KEY); | 3823 | sock_unregister(PF_KEY); |
| 3824 | out_unregister_pernet: | ||
| 3825 | unregister_pernet_subsys(&pfkey_net_ops); | ||
| 3825 | out_unregister_key_proto: | 3826 | out_unregister_key_proto: |
| 3826 | proto_unregister(&key_proto); | 3827 | proto_unregister(&key_proto); |
| 3827 | goto out; | 3828 | goto out; |
