Commit 5ddf0eb2 authored by Robert Olsson's avatar Robert Olsson Committed by David S. Miller

[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: default avatarRobert Olsson <robert.olsson@its.uu.se>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f81c32b
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
* Patrick McHardy <kaber@trash.net> * Patrick McHardy <kaber@trash.net>
*/ */
#define VERSION "0.404" #define VERSION "0.405"
#include <linux/config.h> #include <linux/config.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -2040,7 +2040,15 @@ static struct node *fib_trie_get_next(struct fib_trie_iter *iter) ...@@ -2040,7 +2040,15 @@ static struct node *fib_trie_get_next(struct fib_trie_iter *iter)
static struct node *fib_trie_get_first(struct fib_trie_iter *iter, static struct node *fib_trie_get_first(struct fib_trie_iter *iter,
struct trie *t) 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)) { if (n && IS_TNODE(n)) {
iter->tnode = (struct tnode *) n; iter->tnode = (struct tnode *) n;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment