diff mbox

[PATCHv2,1/4] First Patch on TFRC-SP. Copy base files from TFRC

Message ID 20091019052153.GB3366@gerrit.erg.abdn.ac.uk
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Gerrit Renker Oct. 19, 2009, 5:21 a.m. UTC
| First Patch on TFRC-SP.
Please find attached one edit that I made.

I added unwinding the initialisation of tfrc_lib in the case where the
initialisation of tfrc_sp_lib fails.  Unwinding is now done in the reverse
order of the steps done during initialisation.

Comments

Ivo Calado Oct. 20, 2009, 1:51 p.m. UTC | #1
On Mon, Oct 19, 2009 at 02:21, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> | First Patch on TFRC-SP.
> Please find attached one edit that I made.
>
> I added unwinding the initialisation of tfrc_lib in the case where the
> initialisation of tfrc_sp_lib fails.  Unwinding is now done in the reverse
> order of the steps done during initialisation.
>

Agree.
diff mbox

Patch

--- a/net/dccp/ccid.c
+++ b/net/dccp/ccid.c
@@ -223,7 +223,7 @@  int __init ccid_initialize_builtins(void
 
 	err = tfrc_sp_lib_init();
 	if (err)
-		return err;
+		goto unwind_tfrc_lib;
 
 	for (i = 0; i < ARRAY_SIZE(ccids); i++) {
 		err = ccid_activate(ccids[i]);
@@ -235,8 +235,10 @@  int __init ccid_initialize_builtins(void
 unwind_registrations:
 	while(--i >= 0)
 		ccid_deactivate(ccids[i]);
-	tfrc_lib_exit();
+
 	tfrc_sp_lib_exit();
+unwind_tfrc_lib:	
+	tfrc_lib_exit();
 	return err;
 }
 
@@ -246,6 +248,6 @@  void ccid_cleanup_builtins(void)
 
 	for (i = 0; i < ARRAY_SIZE(ccids); i++)
 		ccid_deactivate(ccids[i]);
-	tfrc_lib_exit();
 	tfrc_sp_lib_exit();
+	tfrc_lib_exit();
 }