summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDaniel Lezcano <dlezcano@fr.ibm.com>2007-12-07 00:40:34 -0800
committerDavid S. Miller <davem@davemloft.net>2008-01-28 14:56:45 -0800
commitd63bddbe90c4fd924b2155ca92a879393d856170 (patch)
tree223d80eca0d44a057b160ddbb229103c27b3e76f /net/ipv6
parent5a3e55d68ec5baac578bf32ba67607088c763657 (diff)
downloadlinux-d63bddbe90c4fd924b2155ca92a879393d856170.tar.bz2
[IPV6]: Make fib6_init to return an error code.
If there is an error in the initialization function, nothing is followed up to the caller. So I add a return value to be set for the init function. 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')
-rw-r--r--net/ipv6/ip6_fib.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 31b60a02512a..c100b44f2b87 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1473,16 +1473,24 @@ void fib6_run_gc(unsigned long dummy)
spin_unlock_bh(&fib6_gc_lock);
}
-void __init fib6_init(void)
+int __init fib6_init(void)
{
+ int ret;
fib6_node_kmem = kmem_cache_create("fib6_nodes",
sizeof(struct fib6_node),
0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
NULL);
-
fib6_tables_init();
- __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib);
+ ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib);
+ if (ret)
+ goto out_kmem_cache_create;
+out:
+ return ret;
+
+out_kmem_cache_create:
+ kmem_cache_destroy(fib6_node_kmem);
+ goto out;
}
void fib6_gc_cleanup(void)