diff options
author | Daniel Lezcano <dlezcano@fr.ibm.com> | 2007-12-07 03:45:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:56:48 -0500 |
commit | f845ab6b7dd872d027c27146c264e46bc16c656a (patch) | |
tree | 4d37b1e258ccb4b07a0b9375279e5af79c42f3d0 /net/ipv6/ip6_fib.c | |
parent | e2fddf5e96df4ac26f2e9ce63053d51cdf3cfe1e (diff) |
[IPV6] route6/fib6: Don't panic a kmem_cache_create.
If the kmem_cache_creation fails, the kernel will panic. It is
acceptable if the system is booting, but if the ipv6 protocol is
compiled as a module and it is loaded after the system has booted, do
we want to panic instead of just failing to initialize the protocol ?
The init function is now returning an error and this one is checked
for protocol initialization. So the ipv6 protocol will safely fails.
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 | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index c100b44f2b87..5fae04506ad9 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -1478,8 +1478,11 @@ int __init fib6_init(void) | |||
1478 | int ret; | 1478 | int ret; |
1479 | fib6_node_kmem = kmem_cache_create("fib6_nodes", | 1479 | fib6_node_kmem = kmem_cache_create("fib6_nodes", |
1480 | sizeof(struct fib6_node), | 1480 | sizeof(struct fib6_node), |
1481 | 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, | 1481 | 0, SLAB_HWCACHE_ALIGN, |
1482 | NULL); | 1482 | NULL); |
1483 | if (!fib6_node_kmem) | ||
1484 | return -ENOMEM; | ||
1485 | |||
1483 | fib6_tables_init(); | 1486 | fib6_tables_init(); |
1484 | 1487 | ||
1485 | ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib); | 1488 | ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib); |