Commit 35f493b8 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: 4cc5b44b ("inetpeer: fix RCU lookup()")
Fixes: b145425f ("inetpeer: remove AVL implementation in favor of RB tree")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d3924c2
......@@ -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;
......
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