diff options
-rw-r--r-- | include/net/xfrm.h | 4 | ||||
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 22 | ||||
-rw-r--r-- | net/ipv6/xfrm6_state.c | 4 |
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 | ||
1067 | extern void xfrm_init(void); | 1067 | extern void xfrm_init(void); |
1068 | extern void xfrm4_init(void); | 1068 | extern void xfrm4_init(void); |
1069 | extern void xfrm6_init(void); | 1069 | extern int xfrm6_init(void); |
1070 | extern void xfrm6_fini(void); | 1070 | extern void xfrm6_fini(void); |
1071 | extern void xfrm_state_init(void); | 1071 | extern void xfrm_state_init(void); |
1072 | extern void xfrm4_state_init(void); | 1072 | extern void xfrm4_state_init(void); |
1073 | extern void xfrm6_state_init(void); | 1073 | extern int xfrm6_state_init(void); |
1074 | extern void xfrm6_state_fini(void); | 1074 | extern void xfrm6_state_fini(void); |
1075 | 1075 | ||
1076 | extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *); | 1076 | extern 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 | ||
272 | static void __init xfrm6_policy_init(void) | 272 | static 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 | ||
277 | static void xfrm6_policy_fini(void) | 277 | static 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 | ||
282 | void __init xfrm6_init(void) | 282 | int __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; | ||
293 | out: | ||
294 | return ret; | ||
295 | out_policy: | ||
296 | xfrm6_policy_fini(); | ||
297 | goto out; | ||
286 | } | 298 | } |
287 | 299 | ||
288 | void xfrm6_fini(void) | 300 | void 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 | ||
201 | void __init xfrm6_state_init(void) | 201 | int __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 | ||
206 | void xfrm6_state_fini(void) | 206 | void xfrm6_state_fini(void) |