From 69ab4b7d6db68396dbfa827daa8d6f30f9b546a8 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Mon, 21 Jan 2008 00:25:15 -0800 Subject: [VLAN]: Clean up initialization code - move module init/exit functions to end of file, remove some now unnecessary forward declarations - remove some obvious comments - clean up proc init function and move a proc-related printk there Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- net/8021q/vlanproc.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'net/8021q/vlanproc.c') diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index 5da02e2..971e623 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c @@ -158,15 +158,18 @@ void vlan_proc_cleanup(void) int __init vlan_proc_init(void) { proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net); - if (proc_vlan_dir) { - proc_vlan_conf = create_proc_entry(name_conf, - S_IFREG|S_IRUSR|S_IWUSR, - proc_vlan_dir); - if (proc_vlan_conf) { - proc_vlan_conf->proc_fops = &vlan_fops; - return 0; - } - } + if (!proc_vlan_dir) + goto err; + + proc_vlan_conf = create_proc_entry(name_conf, S_IFREG|S_IRUSR|S_IWUSR, + proc_vlan_dir); + if (!proc_vlan_conf) + goto err; + proc_vlan_conf->proc_fops = &vlan_fops; + return 0; + +err: + pr_err("%s: can't create entry in proc filesystem!\n", __FUNCTION__); vlan_proc_cleanup(); return -ENOBUFS; } -- cgit v1.1