From: Steven Rostedt (VMware) Date: Fri, 15 Nov 2019 19:13:20 +0000 (-0500) Subject: ftrace: Fix accounting bug with direct->count in register_ftrace_direct() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1c7f9b673dc0a15753274c4e7f5ebfd4468fc69f;p=linux.git ftrace: Fix accounting bug with direct->count in register_ftrace_direct() The direct->count wasn't being updated properly, where it only was updated when the first entry was added, but should be updated every time. Fixes: 013bf0da04748 ("ftrace: Add ftrace_find_direct_func()") Signed-off-by: Steven Rostedt (VMware) --- diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 834f3556ea1e1..32e4e5ffdd974 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -5093,8 +5093,7 @@ int register_ftrace_direct(unsigned long ip, unsigned long addr) ftrace_direct_func_count--; } } else { - if (!direct->count) - direct->count++; + direct->count++; } out_unlock: mutex_unlock(&direct_mutex);