aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/xfrm.h4
-rw-r--r--net/ipv6/xfrm6_policy.c22
-rw-r--r--net/ipv6/xfrm6_state.c4
3 files changed, 21 insertions, 9 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 182f10b29d88..18260921eeb5 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1066,11 +1066,11 @@ struct xfrm6_tunnel {
1066 1066
1067extern void xfrm_init(void); 1067extern void xfrm_init(void);
1068extern void xfrm4_init(void); 1068extern void xfrm4_init(void);
1069extern void xfrm6_init(void); 1069extern int xfrm6_init(void);
1070extern void xfrm6_fini(void); 1070extern void xfrm6_fini(void);
1071extern void xfrm_state_init(void); 1071extern void xfrm_state_init(void);
1072extern void xfrm4_state_init(void); 1072extern void xfrm4_state_init(void);
1073extern void xfrm6_state_init(void); 1073extern int xfrm6_state_init(void);
1074extern void xfrm6_state_fini(void); 1074extern void xfrm6_state_fini(void);
1075 1075
1076extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *); 1076extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *);
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 4d54951cea08..181cf91538f1 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -269,9 +269,9 @@ static struct xfrm_policy_afinfo xfrm6_policy_afinfo = {
269 .fill_dst = xfrm6_fill_dst, 269 .fill_dst = xfrm6_fill_dst,
270}; 270};
271 271
272static void __init xfrm6_policy_init(void) 272static int __init xfrm6_policy_init(void)
273{ 273{
274 xfrm_policy_register_afinfo(&xfrm6_policy_afinfo); 274 return xfrm_policy_register_afinfo(&xfrm6_policy_afinfo);
275} 275}
276 276
277static void xfrm6_policy_fini(void) 277static void xfrm6_policy_fini(void)
@@ -279,10 +279,22 @@ static void xfrm6_policy_fini(void)
279 xfrm_policy_unregister_afinfo(&xfrm6_policy_afinfo); 279 xfrm_policy_unregister_afinfo(&xfrm6_policy_afinfo);
280} 280}
281 281
282void __init xfrm6_init(void) 282int __init xfrm6_init(void)
283{ 283{
284 xfrm6_policy_init(); 284 int ret;
285 xfrm6_state_init(); 285
286 ret = xfrm6_policy_init();
287 if (ret)
288 goto out;
289
290 ret = xfrm6_state_init();
291 if (ret)
292 goto out_policy;
293out:
294 return ret;
295out_policy:
296 xfrm6_policy_fini();
297 goto out;
286} 298}
287 299
288void xfrm6_fini(void) 300void xfrm6_fini(void)
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index a7a7e8fd6a33..dc817e035e23 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -198,9 +198,9 @@ static struct xfrm_state_afinfo xfrm6_state_afinfo = {
198 .transport_finish = xfrm6_transport_finish, 198 .transport_finish = xfrm6_transport_finish,
199}; 199};
200 200
201void __init xfrm6_state_init(void) 201int __init xfrm6_state_init(void)
202{ 202{
203 xfrm_state_register_afinfo(&xfrm6_state_afinfo); 203 return xfrm_state_register_afinfo(&xfrm6_state_afinfo);
204} 204}
205 205
206void xfrm6_state_fini(void) 206void xfrm6_state_fini(void)