aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/rcupdate.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index d32c14de270e..37a642c54871 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -174,10 +174,13 @@ struct rcu_head {
174 * code. 174 * code.
175 */ 175 */
176 176
177#define rcu_assign_pointer(p, v) ({ \ 177#define rcu_assign_pointer(p, v) \
178 smp_wmb(); \ 178 ({ \
179 (p) = (v); \ 179 if (!__builtin_constant_p(v) || \
180 }) 180 ((v) != NULL)) \
181 smp_wmb(); \
182 (p) = (v); \
183 })
181 184
182/** 185/**
183 * synchronize_sched - block until all CPUs have exited any non-preemptive 186 * synchronize_sched - block until all CPUs have exited any non-preemptive