diff options
Diffstat (limited to 'net/atm/clip.c')
-rw-r--r-- | net/atm/clip.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/net/atm/clip.c b/net/atm/clip.c index 121bf6f49148..7ce7bfe3fbad 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -929,12 +929,11 @@ static int arp_seq_open(struct inode *inode, struct file *file) | |||
929 | struct seq_file *seq; | 929 | struct seq_file *seq; |
930 | int rc = -EAGAIN; | 930 | int rc = -EAGAIN; |
931 | 931 | ||
932 | state = kmalloc(sizeof(*state), GFP_KERNEL); | 932 | state = kzalloc(sizeof(*state), GFP_KERNEL); |
933 | if (!state) { | 933 | if (!state) { |
934 | rc = -ENOMEM; | 934 | rc = -ENOMEM; |
935 | goto out_kfree; | 935 | goto out_kfree; |
936 | } | 936 | } |
937 | memset(state, 0, sizeof(*state)); | ||
938 | state->ns.neigh_sub_iter = clip_seq_sub_iter; | 937 | state->ns.neigh_sub_iter = clip_seq_sub_iter; |
939 | 938 | ||
940 | rc = seq_open(file, &arp_seq_ops); | 939 | rc = seq_open(file, &arp_seq_ops); |
@@ -962,7 +961,6 @@ static struct file_operations arp_seq_fops = { | |||
962 | 961 | ||
963 | static int __init atm_clip_init(void) | 962 | static int __init atm_clip_init(void) |
964 | { | 963 | { |
965 | struct proc_dir_entry *p; | ||
966 | neigh_table_init_no_netlink(&clip_tbl); | 964 | neigh_table_init_no_netlink(&clip_tbl); |
967 | 965 | ||
968 | clip_tbl_hook = &clip_tbl; | 966 | clip_tbl_hook = &clip_tbl; |
@@ -972,9 +970,15 @@ static int __init atm_clip_init(void) | |||
972 | 970 | ||
973 | setup_timer(&idle_timer, idle_timer_check, 0); | 971 | setup_timer(&idle_timer, idle_timer_check, 0); |
974 | 972 | ||
975 | p = create_proc_entry("arp", S_IRUGO, atm_proc_root); | 973 | #ifdef CONFIG_PROC_FS |
976 | if (p) | 974 | { |
977 | p->proc_fops = &arp_seq_fops; | 975 | struct proc_dir_entry *p; |
976 | |||
977 | p = create_proc_entry("arp", S_IRUGO, atm_proc_root); | ||
978 | if (p) | ||
979 | p->proc_fops = &arp_seq_fops; | ||
980 | } | ||
981 | #endif | ||
978 | 982 | ||
979 | return 0; | 983 | return 0; |
980 | } | 984 | } |