summaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/xfrm6_policy.c')
-rw-r--r--net/ipv6/xfrm6_policy.c22
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 = {
.fill_dst = xfrm6_fill_dst,
};
-static void __init xfrm6_policy_init(void)
+static int __init xfrm6_policy_init(void)
{
- xfrm_policy_register_afinfo(&xfrm6_policy_afinfo);
+ return xfrm_policy_register_afinfo(&xfrm6_policy_afinfo);
}
static void xfrm6_policy_fini(void)
@@ -279,10 +279,22 @@ static void xfrm6_policy_fini(void)
xfrm_policy_unregister_afinfo(&xfrm6_policy_afinfo);
}
-void __init xfrm6_init(void)
+int __init xfrm6_init(void)
{
- xfrm6_policy_init();
- xfrm6_state_init();
+ int ret;
+
+ ret = xfrm6_policy_init();
+ if (ret)
+ goto out;
+
+ ret = xfrm6_state_init();
+ if (ret)
+ goto out_policy;
+out:
+ return ret;
+out_policy:
+ xfrm6_policy_fini();
+ goto out;
}
void xfrm6_fini(void)
OpenPOWER on IntegriCloud