All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] rcu: Add sparse check for RCU_INIT_POINTER()
@ 2014-09-25 18:03 Pranith Kumar
  2014-09-25 18:10 ` josh
  0 siblings, 1 reply; 3+ messages in thread
From: Pranith Kumar @ 2014-09-25 18:03 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, Steven Rostedt,
	Mathieu Desnoyers, Lai Jiangshan, open list:READ-COPY UPDATE...

Add a sparse check when RCU_INIT_POINTER() is used to assign a non __rcu
annotated pointer. 

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 include/linux/rcupdate.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index a4a819f..a033d8b 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -1047,6 +1047,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
  */
 #define RCU_INIT_POINTER(p, v) \
 	do { \
+		rcu_dereference_sparse(p, __rcu); \
 		p = RCU_INITIALIZER(v); \
 	} while (0)
 
-- 
2.1.0


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

end of thread, other threads:[~2014-09-25 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-25 18:03 [RFC PATCH] rcu: Add sparse check for RCU_INIT_POINTER() Pranith Kumar
2014-09-25 18:10 ` josh
2014-09-25 18:39   ` Pranith Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.