summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2021-11-09 12:42:17 +0100
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2021-11-10 11:56:43 -0500
commit2e6e9058d13a22a6fdd36a8c444ac71d9656003a (patch)
tree9c92cf986ff75d8e243d68cfe6b0921cd96775c7 /kernel
parent51d157946666382e779f94c39891e8e9a020da78 (diff)
downloadlinux-stable-2e6e9058d13a22a6fdd36a8c444ac71d9656003a.tar.gz
linux-stable-2e6e9058d13a22a6fdd36a8c444ac71d9656003a.tar.bz2
linux-stable-2e6e9058d13a22a6fdd36a8c444ac71d9656003a.zip
ftrace/direct: Fix lockup in modify_ftrace_direct_multi
We can't call unregister_ftrace_function under ftrace_lock. Link: https://lkml.kernel.org/r/20211109114217.1645296-1-jolsa@kernel.org Fixes: ed29271894aa ("ftrace/direct: Do not disable when switching direct callers") Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index b4ed1a301232..fc49e8809a56 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5602,10 +5602,11 @@ int modify_ftrace_direct_multi(struct ftrace_ops *ops, unsigned long addr)
}
}
+ mutex_unlock(&ftrace_lock);
+
/* Removing the tmp_ops will add the updated direct callers to the functions */
unregister_ftrace_function(&tmp_ops);
- mutex_unlock(&ftrace_lock);
out_direct:
mutex_unlock(&direct_mutex);
return err;