diff options
author | Robert Olsson <robert.olsson@its.uu.se> | 2006-03-20 21:34:12 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 21:34:12 -0800 |
commit | 5ddf0eb2bfd613e941dd8748870c71da2e5ad409 (patch) | |
tree | 54591328f3ffcaef3b91be801be3e621b99e8463 /net/ipv4/fib_trie.c | |
parent | 4f81c32b028aecd818634b1ef36aae3b2b3e66ce (diff) |
[IPV4]: fib_trie initialzation fix
In some kernel configs /proc functions seems to be accessed before the
trie is initialized. The patch below checks for this.
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_trie.c')
-rw-r--r-- | net/ipv4/fib_trie.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index e320b32373e..8aa31fe514e 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -50,7 +50,7 @@ * Patrick McHardy <kaber@trash.net> */ -#define VERSION "0.404" +#define VERSION "0.405" #include <linux/config.h> #include <asm/uaccess.h> @@ -2040,7 +2040,15 @@ rescan: static struct node *fib_trie_get_first(struct fib_trie_iter *iter, struct trie *t) { - struct node *n = rcu_dereference(t->trie); + struct node *n ; + + if(!t) + return NULL; + + n = rcu_dereference(t->trie); + + if(!iter) + return NULL; if (n && IS_TNODE(n)) { iter->tnode = (struct tnode *) n; |