Skip to contentSkip to conversation

Propagate error from sctp_proc_init

PATCH In review Olaf Kirch 2 participants 2 messages Apr 14, 2004

Subsystems (3)
lore
Share & tools
lore

Olaf Kirch

author
#0 lore raw

PATCH 1/1 Propagate error from sctp_proc_init

The following patch makes sure that an error in sctp_proc_init() causes module initialization to fail.

Olaf

Signature · 3 lines
Olaf Kirch     |  The Hardware Gods hate me.
[email protected]   |
---------------+ 
net/sctp/protocol.c renamed from net/sctp/protocol.c.initfail +4 -1
@@ -1001,7 +1001,9 @@
 		goto err_init_mibs;
 
 	/* Initialize proc fs directory.  */
-	sctp_proc_init();
+	status = sctp_proc_init();
+	if (status)
+		goto err_init_proc;
 
 	/* Initialize object count debugging.  */
 	sctp_dbg_objcnt_init();
@@ -1165,6 +1167,7 @@
 			     sizeof(struct sctp_hashbucket)));
 err_ahash_alloc:
 	sctp_dbg_objcnt_exit();
+err_init_proc:
 	sctp_proc_exit();
 	cleanup_sctp_mibs();
 err_init_mibs:
#1 lore raw

The patch looks fine. Dave, could you apply it both 2.6 and 2.4 trees. It should apply to both of them with a little fuzz.

Thanks
Sridhar

Quoted 9 lines · Olaf Kirch

The following patch makes sure that an error in sctp_proc_init() causes module initialization to fail.

Olaf
--
Olaf Kirch | The Hardware Gods hate me.
[email protected] |
---------------+

net/sctp/protocol.c renamed from net/sctp/protocol.c.initfail +4 -1
@@ -1001,7 +1001,9 @@
 		goto err_init_mibs;
 
 	/* Initialize proc fs directory.  */
-	sctp_proc_init();
+	status = sctp_proc_init();
+	if (status)
+		goto err_init_proc;
 
 	/* Initialize object count debugging.  */
 	sctp_dbg_objcnt_init();
@@ -1165,6 +1167,7 @@
 			     sizeof(struct sctp_hashbucket)));
 err_ahash_alloc:
 	sctp_dbg_objcnt_exit();
+err_init_proc:
 	sctp_proc_exit();
 	cleanup_sctp_mibs();
 err_init_mibs: