inetpeer: fix RCU lookup() again

My prior fix was not complete, as we were dereferencing a pointer
three times per node, not twice as I initially thought.

Fixes: 4cc5b44b29 ("inetpeer: fix RCU lookup()")
Fixes: b145425f26 ("inetpeer: remove AVL implementation in favor of RB tree")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet 2017-09-25 08:40:02 -07:00 committed by David S. Miller
parent 2d3924c218
commit 35f493b87e
1 changed files with 2 additions and 2 deletions

View File

@ -128,9 +128,9 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr,
break;
}
if (cmp == -1)
pp = &(*pp)->rb_left;
pp = &next->rb_left;
else
pp = &(*pp)->rb_right;
pp = &next->rb_right;
}
*parent_p = parent;
*pp_p = pp;