Commit 406acdd3 authored by Steven Rostedt (VMware)'s avatar Steven Rostedt (VMware)
Browse files

ftrace: Add another check for match in register_ftrace_direct()



As an instruction pointer passed into register_ftrace_direct() may just
exist on the ftrace call site, but may not be the start of the call site
itself, register_ftrace_direct() still needs to update test if a direct call
exists on the normalized site, as only one direct call is allowed at any one
time.

Fixes: 763e34e7 ("ftrace: Add register_ftrace_direct()")
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 1c7f9b67
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -5030,7 +5030,12 @@ int register_ftrace_direct(unsigned long ip, unsigned long addr)
		goto out_unlock;

	/* Make sure the ip points to the exact record */
	if (ip != rec->ip) {
		ip = rec->ip;
		/* Need to check this ip for a direct. */
		if (find_rec_direct(ip))
			goto out_unlock;
	}

	ret = -ENOMEM;
	if (ftrace_hash_empty(direct_functions) ||