diff options
Diffstat (limited to 'net/8021q/vlanproc.c')
-rw-r--r-- | net/8021q/vlanproc.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index 5da02e29a2c6..971e6233801e 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
@@ -158,15 +158,18 @@ void vlan_proc_cleanup(void) | |||
158 | int __init vlan_proc_init(void) | 158 | int __init vlan_proc_init(void) |
159 | { | 159 | { |
160 | proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net); | 160 | proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net); |
161 | if (proc_vlan_dir) { | 161 | if (!proc_vlan_dir) |
162 | proc_vlan_conf = create_proc_entry(name_conf, | 162 | goto err; |
163 | S_IFREG|S_IRUSR|S_IWUSR, | 163 | |
164 | proc_vlan_dir); | 164 | proc_vlan_conf = create_proc_entry(name_conf, S_IFREG|S_IRUSR|S_IWUSR, |
165 | if (proc_vlan_conf) { | 165 | proc_vlan_dir); |
166 | proc_vlan_conf->proc_fops = &vlan_fops; | 166 | if (!proc_vlan_conf) |
167 | return 0; | 167 | goto err; |
168 | } | 168 | proc_vlan_conf->proc_fops = &vlan_fops; |
169 | } | 169 | return 0; |
170 | |||
171 | err: | ||
172 | pr_err("%s: can't create entry in proc filesystem!\n", __FUNCTION__); | ||
170 | vlan_proc_cleanup(); | 173 | vlan_proc_cleanup(); |
171 | return -ENOBUFS; | 174 | return -ENOBUFS; |
172 | } | 175 | } |