diff options
Diffstat (limited to 'net/dccp/ccids/lib/tfrc.c')
-rw-r--r-- | net/dccp/ccids/lib/tfrc.c | 31 |
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); | |||
14 | MODULE_PARM_DESC(tfrc_debug, "Enable debug messages"); | 14 | MODULE_PARM_DESC(tfrc_debug, "Enable debug messages"); |
15 | #endif | 15 | #endif |
16 | 16 | ||
17 | extern int tfrc_tx_packet_history_init(void); | ||
18 | extern void tfrc_tx_packet_history_exit(void); | ||
19 | extern int tfrc_rx_packet_history_init(void); | ||
20 | extern void tfrc_rx_packet_history_exit(void); | ||
21 | |||
17 | extern int dccp_li_init(void); | 22 | extern int dccp_li_init(void); |
18 | extern void dccp_li_exit(void); | 23 | extern void dccp_li_exit(void); |
19 | extern int packet_history_init(void); | ||
20 | extern void packet_history_exit(void); | ||
21 | 24 | ||
22 | static int __init tfrc_module_init(void) | 25 | static 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 | |||
41 | out_free_tx_history: | ||
42 | tfrc_tx_packet_history_exit(); | ||
43 | out_free_loss_intervals: | ||
44 | dccp_li_exit(); | ||
45 | out: | ||
32 | return rc; | 46 | return rc; |
33 | } | 47 | } |
34 | 48 | ||
35 | static void __exit tfrc_module_exit(void) | 49 | static 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 | ||