diff options
Diffstat (limited to 'net/8021q/vlanproc.c')
-rw-r--r-- | net/8021q/vlanproc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index 24cd96ee8109..4d13aeb88584 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
@@ -138,8 +138,11 @@ static const char *vlan_name_type_str[VLAN_NAME_TYPE_HIGHEST] = { | |||
138 | * Clean up /proc/net/vlan entries | 138 | * Clean up /proc/net/vlan entries |
139 | */ | 139 | */ |
140 | 140 | ||
141 | void vlan_proc_cleanup(void) | 141 | void vlan_proc_cleanup(struct net *net) |
142 | { | 142 | { |
143 | if (net != &init_net) | ||
144 | return; | ||
145 | |||
143 | if (proc_vlan_conf) | 146 | if (proc_vlan_conf) |
144 | remove_proc_entry(name_conf, proc_vlan_dir); | 147 | remove_proc_entry(name_conf, proc_vlan_dir); |
145 | 148 | ||
@@ -155,8 +158,11 @@ void vlan_proc_cleanup(void) | |||
155 | * Create /proc/net/vlan entries | 158 | * Create /proc/net/vlan entries |
156 | */ | 159 | */ |
157 | 160 | ||
158 | int __init vlan_proc_init(void) | 161 | int vlan_proc_init(struct net *net) |
159 | { | 162 | { |
163 | if (net != &init_net) | ||
164 | return 0; | ||
165 | |||
160 | proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net); | 166 | proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net); |
161 | if (!proc_vlan_dir) | 167 | if (!proc_vlan_dir) |
162 | goto err; | 168 | goto err; |
@@ -169,7 +175,7 @@ int __init vlan_proc_init(void) | |||
169 | 175 | ||
170 | err: | 176 | err: |
171 | pr_err("%s: can't create entry in proc filesystem!\n", __func__); | 177 | pr_err("%s: can't create entry in proc filesystem!\n", __func__); |
172 | vlan_proc_cleanup(); | 178 | vlan_proc_cleanup(net); |
173 | return -ENOBUFS; | 179 | return -ENOBUFS; |
174 | } | 180 | } |
175 | 181 | ||