Skip to content

Commit 1c7f9b6

Browse files
committed
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: 013bf0d ("ftrace: Add ftrace_find_direct_func()") Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 760f8bc commit 1c7f9b6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/trace/ftrace.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5093,8 +5093,7 @@ int register_ftrace_direct(unsigned long ip, unsigned long addr)
50935093
ftrace_direct_func_count--;
50945094
}
50955095
} else {
5096-
if (!direct->count)
5097-
direct->count++;
5096+
direct->count++;
50985097
}
50995098
out_unlock:
51005099
mutex_unlock(&direct_mutex);

0 commit comments

Comments
 (0)