All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: linux-sctp@vger.kernel.org
Subject: [PATCH] SCTP: Remove the proc fs entry if fail to set up proc fs
Date: Fri, 06 Jun 2008 07:39:27 +0000	[thread overview]
Message-ID: <4848E9AF.4010204@cn.fujitsu.com> (raw)

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>

--- a/net/sctp/protocol.c	2008-05-31 23:49:24.000000000 -0400
+++ b/net/sctp/protocol.c	2008-06-01 04:35:40.000000000 -0400
@@ -108,14 +108,23 @@ static __init int sctp_proc_init(void)
	}

	if (sctp_snmp_proc_init())
-		goto out_nomem;
+		goto err_snmp_proc_init;
	if (sctp_eps_proc_init())
-		goto out_nomem;
+		goto err_eps_proc_init;
	if (sctp_assocs_proc_init())
-		goto out_nomem;
+		goto err_assocs_proc_init;

	return 0;

+err_assocs_proc_init:
+	sctp_eps_proc_exit();
+err_eps_proc_init:
+	sctp_snmp_proc_exit();
+err_snmp_proc_init:
+	if (proc_net_sctp) {
+		proc_net_sctp = NULL;
+		remove_proc_entry("sctp", init_net.proc_net);
+	}
out_nomem:
	return -ENOMEM;
}




             reply	other threads:[~2008-06-06  7:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06  7:39 Wei Yongjun [this message]
2008-06-06 11:06 ` [PATCH] SCTP: Remove the proc fs entry if fail to set up proc Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4848E9AF.4010204@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=linux-sctp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.