diff options
-rw-r--r-- | include/net/ip6_fib.h | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_fib.c | 14 |
2 files changed, 12 insertions, 4 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 4cefcffe773e..5d39ce92afcf 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -224,7 +224,7 @@ extern void fib6_run_gc(unsigned long dummy); | |||
224 | 224 | ||
225 | extern void fib6_gc_cleanup(void); | 225 | extern void fib6_gc_cleanup(void); |
226 | 226 | ||
227 | extern void fib6_init(void); | 227 | extern int fib6_init(void); |
228 | 228 | ||
229 | extern void fib6_rules_init(void); | 229 | extern void fib6_rules_init(void); |
230 | extern void fib6_rules_cleanup(void); | 230 | extern void fib6_rules_cleanup(void); |
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) |