diff options
author | Daniel Lezcano <dlezcano@fr.ibm.com> | 2007-12-07 00:42:52 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 14:56:46 -0800 |
commit | 9eb87f3f7e0686a256c5bb4f886dede0171245f2 (patch) | |
tree | 64ca735755b0c5a70eec1cfda0a3ebef5a31c419 /net/ipv6/fib6_rules.c | |
parent | 0013cabab30ec55830ce63d34c0bdd887eb87644 (diff) | |
download | lwn-9eb87f3f7e0686a256c5bb4f886dede0171245f2.tar.gz lwn-9eb87f3f7e0686a256c5bb4f886dede0171245f2.zip |
[IPV6]: Make fib6_rules_init to return an error code.
When the fib_rules initialization finished, no return code is provided
so there is no way to know, for the caller, if the initialization has
been successful or has failed. This patch fix that.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Acked-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/fib6_rules.c')
-rw-r--r-- | net/ipv6/fib6_rules.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index 428c6b0e26d8..9ce2e0a6748a 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) |