Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d63bddbe90c4fd924b2155ca92a879393d856170
Commit:     d63bddbe90c4fd924b2155ca92a879393d856170
Parent:     5a3e55d68ec5baac578bf32ba67607088c763657
Author:     Daniel Lezcano <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 7 00:40:34 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:56:45 2008 -0800

    [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 <[EMAIL PROTECTED]>
    Acked-by: Benjamin Thery <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/ip6_fib.h |    2 +-
 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 4cefcff..5d39ce9 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);
 
 extern void                    fib6_gc_cleanup(void);
 
-extern void                    fib6_init(void);
+extern int                     fib6_init(void);
 
 extern void                    fib6_rules_init(void);
 extern void                    fib6_rules_cleanup(void);
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 31b60a0..c100b44 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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to