aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/8021q/vlan.c')
-rw-r--r--net/8021q/vlan.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 92966016a221..541542e2a2c1 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -642,8 +642,14 @@ static int vlan_init_net(struct net *net)
642 if (err < 0) 642 if (err < 0)
643 goto err_assign; 643 goto err_assign;
644 644
645 err = vlan_proc_init(net);
646 if (err < 0)
647 goto err_proc;
648
645 return 0; 649 return 0;
646 650
651err_proc:
652 /* nothing */
647err_assign: 653err_assign:
648 kfree(vn); 654 kfree(vn);
649err_alloc: 655err_alloc:
@@ -655,6 +661,7 @@ static void vlan_exit_net(struct net *net)
655 struct vlan_net *vn; 661 struct vlan_net *vn;
656 662
657 vn = net_generic(net, vlan_net_id); 663 vn = net_generic(net, vlan_net_id);
664 vlan_proc_cleanup(net);
658 kfree(vn); 665 kfree(vn);
659} 666}
660 667
@@ -674,10 +681,6 @@ static int __init vlan_proto_init(void)
674 if (err < 0) 681 if (err < 0)
675 goto err0; 682 goto err0;
676 683
677 err = vlan_proc_init();
678 if (err < 0)
679 goto err1;
680
681 err = register_netdevice_notifier(&vlan_notifier_block); 684 err = register_netdevice_notifier(&vlan_notifier_block);
682 if (err < 0) 685 if (err < 0)
683 goto err2; 686 goto err2;
@@ -693,8 +696,6 @@ static int __init vlan_proto_init(void)
693err3: 696err3:
694 unregister_netdevice_notifier(&vlan_notifier_block); 697 unregister_netdevice_notifier(&vlan_notifier_block);
695err2: 698err2:
696 vlan_proc_cleanup();
697err1:
698 unregister_pernet_gen_device(vlan_net_id, &vlan_net_ops); 699 unregister_pernet_gen_device(vlan_net_id, &vlan_net_ops);
699err0: 700err0:
700 return err; 701 return err;
@@ -715,8 +716,6 @@ static void __exit vlan_cleanup_module(void)
715 for (i = 0; i < VLAN_GRP_HASH_SIZE; i++) 716 for (i = 0; i < VLAN_GRP_HASH_SIZE; i++)
716 BUG_ON(!hlist_empty(&vlan_group_hash[i])); 717 BUG_ON(!hlist_empty(&vlan_group_hash[i]));
717 718
718 vlan_proc_cleanup();
719
720 unregister_pernet_gen_device(vlan_net_id, &vlan_net_ops); 719 unregister_pernet_gen_device(vlan_net_id, &vlan_net_ops);
721 720
722 synchronize_net(); 721 synchronize_net();