aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm
diff options
context:
space:
mode:
Diffstat (limited to 'net/atm')
-rw-r--r--net/atm/clip.c19
-rw-r--r--net/atm/lec.c4
2 files changed, 20 insertions, 3 deletions
diff --git a/net/atm/clip.c b/net/atm/clip.c
index d45971bd286c..e82da6746723 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -943,6 +943,8 @@ static const struct file_operations arp_seq_fops = {
943}; 943};
944#endif 944#endif
945 945
946static void atm_clip_exit_noproc(void);
947
946static int __init atm_clip_init(void) 948static int __init atm_clip_init(void)
947{ 949{
948 neigh_table_init_no_netlink(&clip_tbl); 950 neigh_table_init_no_netlink(&clip_tbl);
@@ -959,18 +961,22 @@ static int __init atm_clip_init(void)
959 struct proc_dir_entry *p; 961 struct proc_dir_entry *p;
960 962
961 p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops); 963 p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops);
964 if (!p) {
965 printk(KERN_ERR "Unable to initialize "
966 "/proc/net/atm/arp\n");
967 atm_clip_exit_noproc();
968 return -ENOMEM;
969 }
962 } 970 }
963#endif 971#endif
964 972
965 return 0; 973 return 0;
966} 974}
967 975
968static void __exit atm_clip_exit(void) 976static void atm_clip_exit_noproc(void)
969{ 977{
970 struct net_device *dev, *next; 978 struct net_device *dev, *next;
971 979
972 remove_proc_entry("arp", atm_proc_root);
973
974 unregister_inetaddr_notifier(&clip_inet_notifier); 980 unregister_inetaddr_notifier(&clip_inet_notifier);
975 unregister_netdevice_notifier(&clip_dev_notifier); 981 unregister_netdevice_notifier(&clip_dev_notifier);
976 982
@@ -1001,6 +1007,13 @@ static void __exit atm_clip_exit(void)
1001 clip_tbl_hook = NULL; 1007 clip_tbl_hook = NULL;
1002} 1008}
1003 1009
1010static void __exit atm_clip_exit(void)
1011{
1012 remove_proc_entry("arp", atm_proc_root);
1013
1014 atm_clip_exit_noproc();
1015}
1016
1004module_init(atm_clip_init); 1017module_init(atm_clip_init);
1005module_exit(atm_clip_exit); 1018module_exit(atm_clip_exit);
1006MODULE_AUTHOR("Werner Almesberger"); 1019MODULE_AUTHOR("Werner Almesberger");
diff --git a/net/atm/lec.c b/net/atm/lec.c
index e2d800d818e3..aa3785ebf6d1 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1225,6 +1225,10 @@ static int __init lane_module_init(void)
1225 struct proc_dir_entry *p; 1225 struct proc_dir_entry *p;
1226 1226
1227 p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops); 1227 p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops);
1228 if (!p) {
1229 printk(KERN_ERR "Unable to initialize /proc/net/atm/lec\n");
1230 return -ENOMEM;
1231 }
1228#endif 1232#endif
1229 1233
1230 register_atm_ioctl(&lane_ioctl_ops); 1234 register_atm_ioctl(&lane_ioctl_ops);