diff options
author | Daniel Lezcano <dlezcano@fr.ibm.com> | 2007-12-07 03:40:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:56:45 -0500 |
commit | d63bddbe90c4fd924b2155ca92a879393d856170 (patch) | |
tree | 223d80eca0d44a057b160ddbb229103c27b3e76f /net/ipv6/ip6_fib.c | |
parent | 5a3e55d68ec5baac578bf32ba67607088c763657 (diff) |
[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/ip6_fib.c')
-rw-r--r-- | net/ipv6/ip6_fib.c | 14 |
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) | |||
1473 | spin_unlock_bh(&fib6_gc_lock); | 1473 | spin_unlock_bh(&fib6_gc_lock); |
1474 | } | 1474 | } |
1475 | 1475 | ||
1476 | void __init fib6_init(void) | 1476 | int __init fib6_init(void) |
1477 | { | 1477 | { |
1478 | int ret; | ||
1478 | fib6_node_kmem = kmem_cache_create("fib6_nodes", | 1479 | fib6_node_kmem = kmem_cache_create("fib6_nodes", |
1479 | sizeof(struct fib6_node), | 1480 | sizeof(struct fib6_node), |
1480 | 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, | 1481 | 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, |
1481 | NULL); | 1482 | NULL); |
1482 | |||
1483 | fib6_tables_init(); | 1483 | fib6_tables_init(); |
1484 | 1484 | ||
1485 | __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib); | 1485 | ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib); |
1486 | if (ret) | ||
1487 | goto out_kmem_cache_create; | ||
1488 | out: | ||
1489 | return ret; | ||
1490 | |||
1491 | out_kmem_cache_create: | ||
1492 | kmem_cache_destroy(fib6_node_kmem); | ||
1493 | goto out; | ||
1486 | } | 1494 | } |
1487 | 1495 | ||
1488 | void fib6_gc_cleanup(void) | 1496 | void fib6_gc_cleanup(void) |