summaryrefslogtreecommitdiff
path: root/net/ipv6/fib6_rules.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/fib6_rules.c')
-rw-r--r--net/ipv6/fib6_rules.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 428c6b0e26d..9ce2e0a6748 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -265,10 +265,23 @@ static int __init fib6_default_rules_init(void)
return 0;
}
-void __init fib6_rules_init(void)
+int __init fib6_rules_init(void)
{
- BUG_ON(fib6_default_rules_init());
- fib_rules_register(&fib6_rules_ops);
+ int ret;
+
+ ret = fib6_default_rules_init();
+ if (ret)
+ goto out;
+
+ ret = fib_rules_register(&fib6_rules_ops);
+ if (ret)
+ goto out_default_rules_init;
+out:
+ return ret;
+
+out_default_rules_init:
+ fib_rules_cleanup_ops(&fib6_rules_ops);
+ goto out;
}
void fib6_rules_cleanup(void)