Skip to contentSkip to conversation

SCTP: Remove the proc fs entry if fail to set up proc fs

PATCH In review Wei Yongjun 2 participants 2 messages Jun 6, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SCTP: Remove the proc fs entry if fail to set up proc fs

This patch remove the proc fs entry which has been created if fail to set up proc fs entry for the SCTP protocol.

net/sctp/protocol.c +0 -0
@@ -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;
}
Acked-by on v1 1/1
#1 lore raw

Re: [PATCH] SCTP: Remove the proc fs entry if fail to set up proc

Quoted 37 lines · Wei Yongjun

This patch remove the proc fs entry which has been created if fail to set up proc fs entry for the SCTP protocol.

net/sctp/protocol.c +12 -3
@@ -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;
}
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 4 lines
/****************************************************
 * Neil Horman <[email protected]>
 * Software Engineer, Red Hat
 ****************************************************/