aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/lib/tfrc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ccids/lib/tfrc.c')
-rw-r--r--net/dccp/ccids/lib/tfrc.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/net/dccp/ccids/lib/tfrc.c b/net/dccp/ccids/lib/tfrc.c
index 3a7a1838a64b..20763fa75d44 100644
--- a/net/dccp/ccids/lib/tfrc.c
+++ b/net/dccp/ccids/lib/tfrc.c
@@ -14,27 +14,42 @@ module_param(tfrc_debug, bool, 0444);
14MODULE_PARM_DESC(tfrc_debug, "Enable debug messages"); 14MODULE_PARM_DESC(tfrc_debug, "Enable debug messages");
15#endif 15#endif
16 16
17extern int tfrc_tx_packet_history_init(void);
18extern void tfrc_tx_packet_history_exit(void);
19extern int tfrc_rx_packet_history_init(void);
20extern void tfrc_rx_packet_history_exit(void);
21
17extern int dccp_li_init(void); 22extern int dccp_li_init(void);
18extern void dccp_li_exit(void); 23extern void dccp_li_exit(void);
19extern int packet_history_init(void);
20extern void packet_history_exit(void);
21 24
22static int __init tfrc_module_init(void) 25static int __init tfrc_module_init(void)
23{ 26{
24 int rc = dccp_li_init(); 27 int rc = dccp_li_init();
25 28
26 if (rc == 0) { 29 if (rc)
27 rc = packet_history_init(); 30 goto out;
28 if (rc != 0) 31
29 dccp_li_exit(); 32 rc = tfrc_tx_packet_history_init();
30 } 33 if (rc)
34 goto out_free_loss_intervals;
31 35
36 rc = tfrc_rx_packet_history_init();
37 if (rc)
38 goto out_free_tx_history;
39 return 0;
40
41out_free_tx_history:
42 tfrc_tx_packet_history_exit();
43out_free_loss_intervals:
44 dccp_li_exit();
45out:
32 return rc; 46 return rc;
33} 47}
34 48
35static void __exit tfrc_module_exit(void) 49static void __exit tfrc_module_exit(void)
36{ 50{
37 packet_history_exit(); 51 tfrc_rx_packet_history_exit();
52 tfrc_tx_packet_history_exit();
38 dccp_li_exit(); 53 dccp_li_exit();
39} 54}
40 55