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: 013bf0da04 ("ftrace: Add ftrace_find_direct_func()")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
Steven Rostedt (VMware) 2019-11-15 14:13:20 -05:00
parent 760f8bc7c8
commit 1c7f9b673d

View File

@ -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);