diff options
-rw-r--r-- | net/ipv4/fib_trie.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index f5fba3f71c06..2d895274b7f8 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1762,11 +1762,9 @@ static struct leaf *trie_leafindex(struct trie *t, int index) | |||
1762 | { | 1762 | { |
1763 | struct leaf *l = trie_firstleaf(t); | 1763 | struct leaf *l = trie_firstleaf(t); |
1764 | 1764 | ||
1765 | while (index-- > 0) { | 1765 | while (l && index-- > 0) |
1766 | l = trie_nextleaf(l); | 1766 | l = trie_nextleaf(l); |
1767 | if (!l) | 1767 | |
1768 | break; | ||
1769 | } | ||
1770 | return l; | 1768 | return l; |
1771 | } | 1769 | } |
1772 | 1770 | ||