netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] neigh: Add missing rcu_assign_pointer
@ 2015-05-28  8:28 Ying Xue
  2015-05-28 10:13 ` Eric Dumazet
  0 siblings, 1 reply; 8+ messages in thread
From: Ying Xue @ 2015-05-28  8:28 UTC (permalink / raw)
  To: netdev; +Cc: eric.dumazet

Commit e4c4e448cf55 ("neigh: Convert garbage collection from softirq
to workqueue") misses to use rcu_assign_pointer() macro to assign a
RCU-protected pointer.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
---
 net/core/neighbour.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 3a74df7..aaad3a5 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -783,7 +783,8 @@ static void neigh_periodic_work(struct work_struct *work)
 			if (atomic_read(&n->refcnt) == 1 &&
 			    (state == NUD_FAILED ||
 			     time_after(jiffies, n->used + NEIGH_VAR(n->parms, GC_STALETIME)))) {
-				*np = n->next;
+				rcu_assign_pointer(*np, rcu_dereference_protected(n->next,
+								lockdep_is_held(&tbl->lock)));
 				n->dead = 1;
 				write_unlock(&n->lock);
 				neigh_cleanup_and_release(n);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-29  2:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28  8:28 [PATCH net-next] neigh: Add missing rcu_assign_pointer Ying Xue
2015-05-28 10:13 ` Eric Dumazet
2015-05-28 13:50   ` Herbert Xu
2015-05-28 14:38     ` Eric Dumazet
2015-05-29  0:24       ` Herbert Xu
2015-05-29  1:21   ` Ying Xue
2015-05-29  1:50     ` Eric Dumazet
2015-05-29  2:04       ` Ying Xue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).