diff options
Diffstat (limited to 'net/ipv6/xfrm6_policy.c')
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 22 |
1 files changed, 17 insertions, 5 deletions
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) |