diff options
Diffstat (limited to 'net/key')
-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 e2aacf0ba013..41dd2cb07ef3 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -3793,9 +3793,9 @@ static struct pernet_operations pfkey_net_ops = { | |||
3793 | 3793 | ||
3794 | static void __exit ipsec_pfkey_exit(void) | 3794 | static void __exit ipsec_pfkey_exit(void) |
3795 | { | 3795 | { |
3796 | unregister_pernet_subsys(&pfkey_net_ops); | ||
3797 | xfrm_unregister_km(&pfkeyv2_mgr); | 3796 | xfrm_unregister_km(&pfkeyv2_mgr); |
3798 | sock_unregister(PF_KEY); | 3797 | sock_unregister(PF_KEY); |
3798 | unregister_pernet_subsys(&pfkey_net_ops); | ||
3799 | proto_unregister(&key_proto); | 3799 | proto_unregister(&key_proto); |
3800 | } | 3800 | } |
3801 | 3801 | ||
@@ -3806,21 +3806,22 @@ static int __init ipsec_pfkey_init(void) | |||
3806 | if (err != 0) | 3806 | if (err != 0) |
3807 | goto out; | 3807 | goto out; |
3808 | 3808 | ||
3809 | err = sock_register(&pfkey_family_ops); | 3809 | err = register_pernet_subsys(&pfkey_net_ops); |
3810 | if (err != 0) | 3810 | if (err != 0) |
3811 | goto out_unregister_key_proto; | 3811 | goto out_unregister_key_proto; |
3812 | err = sock_register(&pfkey_family_ops); | ||
3813 | if (err != 0) | ||
3814 | goto out_unregister_pernet; | ||
3812 | err = xfrm_register_km(&pfkeyv2_mgr); | 3815 | err = xfrm_register_km(&pfkeyv2_mgr); |
3813 | if (err != 0) | 3816 | if (err != 0) |
3814 | goto out_sock_unregister; | 3817 | goto out_sock_unregister; |
3815 | err = register_pernet_subsys(&pfkey_net_ops); | ||
3816 | if (err != 0) | ||
3817 | goto out_xfrm_unregister_km; | ||
3818 | out: | 3818 | out: |
3819 | return err; | 3819 | return err; |
3820 | out_xfrm_unregister_km: | 3820 | |
3821 | xfrm_unregister_km(&pfkeyv2_mgr); | ||
3822 | out_sock_unregister: | 3821 | out_sock_unregister: |
3823 | sock_unregister(PF_KEY); | 3822 | sock_unregister(PF_KEY); |
3823 | out_unregister_pernet: | ||
3824 | unregister_pernet_subsys(&pfkey_net_ops); | ||
3824 | out_unregister_key_proto: | 3825 | out_unregister_key_proto: |
3825 | proto_unregister(&key_proto); | 3826 | proto_unregister(&key_proto); |
3826 | goto out; | 3827 | goto out; |