Skip to content

Commit 1a8a804

Browse files
committed
Merge tag 'trace-v6.3-rc5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull tracing fixes from Steven Rostedt: "A couple more minor fixes: - Reset direct->addr back to its original value on error in updating the direct trampoline code - Make lastcmd_mutex static" * tag 'trace-v6.3-rc5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing/synthetic: Make lastcmd_mutex static ftrace: Fix issue that 'direct->addr' not restored in modify_ftrace_direct()
2 parents 6fda0bb + 31c6839 commit 1a8a804

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

kernel/trace/ftrace.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5667,12 +5667,15 @@ int modify_ftrace_direct(unsigned long ip,
56675667
ret = 0;
56685668
}
56695669

5670-
if (unlikely(ret && new_direct)) {
5671-
direct->count++;
5672-
list_del_rcu(&new_direct->next);
5673-
synchronize_rcu_tasks();
5674-
kfree(new_direct);
5675-
ftrace_direct_func_count--;
5670+
if (ret) {
5671+
direct->addr = old_addr;
5672+
if (unlikely(new_direct)) {
5673+
direct->count++;
5674+
list_del_rcu(&new_direct->next);
5675+
synchronize_rcu_tasks();
5676+
kfree(new_direct);
5677+
ftrace_direct_func_count--;
5678+
}
56765679
}
56775680

56785681
out_unlock:

kernel/trace/trace_events_synth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ enum { ERRORS };
4444

4545
static const char *err_text[] = { ERRORS };
4646

47-
DEFINE_MUTEX(lastcmd_mutex);
47+
static DEFINE_MUTEX(lastcmd_mutex);
4848
static char *last_cmd;
4949

5050
static int errpos(const char *str)

0 commit comments

Comments
 (0)