Skip to content

Commit 2e6e905

Browse files
Jiri Olsarostedt
authored andcommitted
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/[email protected] Fixes: ed29271 ("ftrace/direct: Do not disable when switching direct callers") Signed-off-by: Jiri Olsa <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 51d1579 commit 2e6e905

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/trace/ftrace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5602,10 +5602,11 @@ int modify_ftrace_direct_multi(struct ftrace_ops *ops, unsigned long addr)
56025602
}
56035603
}
56045604

5605+
mutex_unlock(&ftrace_lock);
5606+
56055607
/* Removing the tmp_ops will add the updated direct callers to the functions */
56065608
unregister_ftrace_function(&tmp_ops);
56075609

5608-
mutex_unlock(&ftrace_lock);
56095610
out_direct:
56105611
mutex_unlock(&direct_mutex);
56115612
return err;

0 commit comments

Comments
 (0)