Skip to content

Commit 5ddf0eb

Browse files
Robert Olssondavem330
authored andcommitted
[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>
1 parent 4f81c32 commit 5ddf0eb

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎net/ipv4/fib_trie.c‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* Patrick McHardy <kaber@trash.net>
5151
*/
5252

53-
#define VERSION "0.404"
53+
#define VERSION "0.405"
5454

5555
#include <linux/config.h>
5656
#include <asm/uaccess.h>
@@ -2040,7 +2040,15 @@ static struct node *fib_trie_get_next(struct fib_trie_iter *iter)
20402040
static struct node *fib_trie_get_first(struct fib_trie_iter *iter,
20412041
struct trie *t)
20422042
{
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;
20442052

20452053
if (n && IS_TNODE(n)) {
20462054
iter->tnode = (struct tnode *) n;

0 commit comments

Comments
 (0)