diff options
Diffstat (limited to '')
-rw-r--r-- | kernel/trace/tracing_map.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c index 51a9d1185..d47641f97 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c @@ -574,7 +574,12 @@ __tracing_map_insert(struct tracing_map *map, void *key, bool lookup_only) } memcpy(elt->key, key, map->key_size); - entry->val = elt; + /* + * Ensure the initialization is visible and + * publish the elt. + */ + smp_wmb(); + WRITE_ONCE(entry->val, elt); atomic64_inc(&map->hits); return entry->val; |