aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/tracepoint.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index db39961a0d03..f2b7c28a4708 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -356,6 +356,8 @@ int tracepoint_probe_register(const char *name, void *probe)
356 mutex_lock(&tracepoints_mutex); 356 mutex_lock(&tracepoints_mutex);
357 entry = get_tracepoint(name); 357 entry = get_tracepoint(name);
358 WARN_ON(!entry); 358 WARN_ON(!entry);
359 if (entry->rcu_pending)
360 rcu_barrier_sched();
359 tracepoint_entry_free_old(entry, old); 361 tracepoint_entry_free_old(entry, old);
360end: 362end:
361 mutex_unlock(&tracepoints_mutex); 363 mutex_unlock(&tracepoints_mutex);
@@ -392,6 +394,8 @@ int tracepoint_probe_unregister(const char *name, void *probe)
392 entry = get_tracepoint(name); 394 entry = get_tracepoint(name);
393 if (!entry) 395 if (!entry)
394 goto end; 396 goto end;
397 if (entry->rcu_pending)
398 rcu_barrier_sched();
395 tracepoint_entry_free_old(entry, old); 399 tracepoint_entry_free_old(entry, old);
396 remove_tracepoint(name); /* Ignore busy error message */ 400 remove_tracepoint(name); /* Ignore busy error message */
397 ret = 0; 401 ret = 0;