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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



| 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.
--- 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();
 }

[Index of Archives]     [Linux Kernel]     [IETF DCCP]     [Linux Networking]     [Git]     [Security]     [Linux Assembly]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

Powered by Linux