projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4f8b5d
)
fib_trie: handle empty tree
author
Stephen Hemminger
<shemminger@vyatta.com>
Tue, 12 Feb 2008 05:12:49 +0000
(21:12 -0800)
committer
David S. Miller
<davem@davemloft.net>
Wed, 13 Feb 2008 01:53:30 +0000
(17:53 -0800)
This fixes possible problems when trie_firstleaf() returns NULL
to trie_leafindex().
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c
patch
|
blob
|
blame
|
history
diff --git
a/net/ipv4/fib_trie.c
b/net/ipv4/fib_trie.c
index f5fba3f71c06e09283a29d48f2719bc9ad1be15b..2d895274b7f82f959132dd39053acf5550180439 100644
(file)
--- 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)
{
struct leaf *l = trie_firstleaf(t);
- while (
index-- > 0) {
+ while (
l && index-- > 0)
l = trie_nextleaf(l);
- if (!l)
- break;
- }
+
return l;
}