You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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>
This commit is contained in:
committed by
David S. Miller
parent
0013cabab3
commit
9eb87f3f7e
@@ -102,7 +102,7 @@ errout:
|
||||
|
||||
EXPORT_SYMBOL_GPL(fib_rules_register);
|
||||
|
||||
static void cleanup_ops(struct fib_rules_ops *ops)
|
||||
void fib_rules_cleanup_ops(struct fib_rules_ops *ops)
|
||||
{
|
||||
struct fib_rule *rule, *tmp;
|
||||
|
||||
@@ -111,6 +111,7 @@ static void cleanup_ops(struct fib_rules_ops *ops)
|
||||
fib_rule_put(rule);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops);
|
||||
|
||||
int fib_rules_unregister(struct fib_rules_ops *ops)
|
||||
{
|
||||
@@ -121,7 +122,7 @@ int fib_rules_unregister(struct fib_rules_ops *ops)
|
||||
list_for_each_entry(o, &rules_ops, list) {
|
||||
if (o == ops) {
|
||||
list_del_rcu(&o->list);
|
||||
cleanup_ops(ops);
|
||||
fib_rules_cleanup_ops(ops);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
+16
-3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user