diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2008-06-16 16:59:55 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-16 16:59:55 -0700 |
commit | 80896a3584bbff9ff9ad4dde735517c4de68d736 (patch) | |
tree | 0646aee2e49f0d8c789a3239d579a6e9e7fee0bb /net | |
parent | 93653e0448196344d7699ccad395eaebd30359d1 (diff) | |
download | op-kernel-dev-80896a3584bbff9ff9ad4dde735517c4de68d736.zip op-kernel-dev-80896a3584bbff9ff9ad4dde735517c4de68d736.tar.gz |
sctp: Correctly cleanup procfs entries upon failure.
This patch remove the proc fs entry which has been created if fail to
set up proc fs entry for the SCTP protocol.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/protocol.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index b435a19..9258dfe 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -108,14 +108,23 @@ static __init int sctp_proc_init(void) } if (sctp_snmp_proc_init()) - goto out_nomem; + goto out_snmp_proc_init; if (sctp_eps_proc_init()) - goto out_nomem; + goto out_eps_proc_init; if (sctp_assocs_proc_init()) - goto out_nomem; + goto out_assocs_proc_init; return 0; +out_assocs_proc_init: + sctp_eps_proc_exit(); +out_eps_proc_init: + sctp_snmp_proc_exit(); +out_snmp_proc_init: + if (proc_net_sctp) { + proc_net_sctp = NULL; + remove_proc_entry("sctp", init_net.proc_net); + } out_nomem: return -ENOMEM; } |