diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-07-18 07:06:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-18 07:06:50 -0400 |
commit | 60bdde95807e982a824be9cfdd35055cc721a88a (patch) | |
tree | 286bd367b687f9a1daddcc6b0fde2f2e8ef4c0ef /net | |
parent | 8e3461d01bdbc3dbf993448ed9ad4acaaeb6495d (diff) |
proc: clean the ip_misc_proc_init and ip_proc_init_net error paths
After all this stuff is moved outside, this function can look better.
Besides, I tuned the error path in ip_proc_init_net to make it have
only 2 exit points, not 3.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/proc.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index 120e1f7461da..554390431a4e 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c | |||
@@ -508,7 +508,7 @@ static const struct file_operations netstat_seq_fops = { | |||
508 | static __net_init int ip_proc_init_net(struct net *net) | 508 | static __net_init int ip_proc_init_net(struct net *net) |
509 | { | 509 | { |
510 | if (!proc_net_fops_create(net, "sockstat", S_IRUGO, &sockstat_seq_fops)) | 510 | if (!proc_net_fops_create(net, "sockstat", S_IRUGO, &sockstat_seq_fops)) |
511 | return -ENOMEM; | 511 | goto out_sockstat; |
512 | if (!proc_net_fops_create(net, "netstat", S_IRUGO, &netstat_seq_fops)) | 512 | if (!proc_net_fops_create(net, "netstat", S_IRUGO, &netstat_seq_fops)) |
513 | goto out_netstat; | 513 | goto out_netstat; |
514 | if (!proc_net_fops_create(net, "snmp", S_IRUGO, &snmp_seq_fops)) | 514 | if (!proc_net_fops_create(net, "snmp", S_IRUGO, &snmp_seq_fops)) |
@@ -520,6 +520,7 @@ out_snmp: | |||
520 | proc_net_remove(net, "netstat"); | 520 | proc_net_remove(net, "netstat"); |
521 | out_netstat: | 521 | out_netstat: |
522 | proc_net_remove(net, "sockstat"); | 522 | proc_net_remove(net, "sockstat"); |
523 | out_sockstat: | ||
523 | return -ENOMEM; | 524 | return -ENOMEM; |
524 | } | 525 | } |
525 | 526 | ||
@@ -537,16 +538,6 @@ static __net_initdata struct pernet_operations ip_proc_ops = { | |||
537 | 538 | ||
538 | int __init ip_misc_proc_init(void) | 539 | int __init ip_misc_proc_init(void) |
539 | { | 540 | { |
540 | int rc = 0; | 541 | return register_pernet_subsys(&ip_proc_ops); |
541 | |||
542 | if (register_pernet_subsys(&ip_proc_ops)) | ||
543 | goto out_pernet; | ||
544 | |||
545 | out: | ||
546 | return rc; | ||
547 | |||
548 | out_pernet: | ||
549 | rc = -ENOMEM; | ||
550 | goto out; | ||
551 | } | 542 | } |
552 | 543 | ||