summaryrefslogtreecommitdiff
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 = {
};
#endif
+static void atm_clip_exit_noproc(void);
+
static int __init atm_clip_init(void)
{
neigh_table_init_no_netlink(&clip_tbl);
@@ -959,18 +961,22 @@ static int __init atm_clip_init(void)
struct proc_dir_entry *p;
p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops);
+ if (!p) {
+ printk(KERN_ERR "Unable to initialize "
+ "/proc/net/atm/arp\n");
+ atm_clip_exit_noproc();
+ return -ENOMEM;
+ }
}
#endif
return 0;
}
-static void __exit atm_clip_exit(void)
+static void atm_clip_exit_noproc(void)
{
struct net_device *dev, *next;
- remove_proc_entry("arp", atm_proc_root);
-
unregister_inetaddr_notifier(&clip_inet_notifier);
unregister_netdevice_notifier(&clip_dev_notifier);
@@ -1001,6 +1007,13 @@ static void __exit atm_clip_exit(void)
clip_tbl_hook = NULL;
}
+static void __exit atm_clip_exit(void)
+{
+ remove_proc_entry("arp", atm_proc_root);
+
+ atm_clip_exit_noproc();
+}
+
module_init(atm_clip_init);
module_exit(atm_clip_exit);
MODULE_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)
struct proc_dir_entry *p;
p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops);
+ if (!p) {
+ printk(KERN_ERR "Unable to initialize /proc/net/atm/lec\n");
+ return -ENOMEM;
+ }
#endif
register_atm_ioctl(&lane_ioctl_ops);