diff options
author | Robert Olsson <robert.olsson@its.uu.se> | 2006-03-21 00:34:12 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 00:34:12 -0500 |
commit | 5ddf0eb2bfd613e941dd8748870c71da2e5ad409 (patch) | |
tree | 54591328f3ffcaef3b91be801be3e621b99e8463 | |
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>
-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 e320b32373e5..8aa31fe514ee 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -50,7 +50,7 @@ | |||
50 | * Patrick McHardy <kaber@trash.net> | 50 | * Patrick McHardy <kaber@trash.net> |
51 | */ | 51 | */ |
52 | 52 | ||
53 | #define VERSION "0.404" | 53 | #define VERSION "0.405" |
54 | 54 | ||
55 | #include <linux/config.h> | 55 | #include <linux/config.h> |
56 | #include <asm/uaccess.h> | 56 | #include <asm/uaccess.h> |
@@ -2040,7 +2040,15 @@ rescan: | |||
2040 | static struct node *fib_trie_get_first(struct fib_trie_iter *iter, | 2040 | static struct node *fib_trie_get_first(struct fib_trie_iter *iter, |
2041 | struct trie *t) | 2041 | struct trie *t) |
2042 | { | 2042 | { |
2043 | struct node *n = rcu_dereference(t->trie); | 2043 | struct node *n ; |
2044 | |||
2045 | if(!t) | ||
2046 | return NULL; | ||
2047 | |||
2048 | n = rcu_dereference(t->trie); | ||
2049 | |||
2050 | if(!iter) | ||
2051 | return NULL; | ||
2044 | 2052 | ||
2045 | if (n && IS_TNODE(n)) { | 2053 | if (n && IS_TNODE(n)) { |
2046 | iter->tnode = (struct tnode *) n; | 2054 | iter->tnode = (struct tnode *) n; |