diff options
author | Eric Dumazet <edumazet@google.com> | 2012-07-17 22:42:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-17 13:47:33 -0700 |
commit | 5abf7f7e0f6bdbfcac737f636497d7016d9507eb (patch) | |
tree | c52a21ed83a306c6626a00378934a28a6daa8db0 /net/ipv4/fib_semantics.c | |
parent | d3a25c980fc231238256f8d80816367674e5caaf (diff) | |
download | op-kernel-dev-5abf7f7e0f6bdbfcac737f636497d7016d9507eb.zip op-kernel-dev-5abf7f7e0f6bdbfcac737f636497d7016d9507eb.tar.gz |
ipv4: fix rcu splat
free_nh_exceptions() should use rcu_dereference_protected(..., 1)
since its called after one RCU grace period.
Also add some const-ification in recent code.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r-- | net/ipv4/fib_semantics.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 1e09852..2b57d76 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -148,11 +148,11 @@ static void free_nh_exceptions(struct fib_nh *nh) for (i = 0; i < FNHE_HASH_SIZE; i++) { struct fib_nh_exception *fnhe; - fnhe = rcu_dereference(hash[i].chain); + fnhe = rcu_dereference_protected(hash[i].chain, 1); while (fnhe) { struct fib_nh_exception *next; - next = rcu_dereference(fnhe->fnhe_next); + next = rcu_dereference_protected(fnhe->fnhe_next, 1); kfree(fnhe); fnhe = next; |