Skip to content
Commit d5e47505 authored by Miroslav Benes's avatar Miroslav Benes Committed by Steven Rostedt (VMware)
Browse files

ftrace: Free the trampoline when ftrace_startup() fails

Commit fc0ea795 ("ftrace: Add symbols for ftrace trampolines")
missed to remove ops from new ftrace_ops_trampoline_list in
ftrace_startup() if ftrace_hash_ipmodify_enable() fails there. It may
lead to BUG if such ops come from a module which may be removed.

Moreover, the trampoline itself is not freed in this case.

Fix it by calling ftrace_trampoline_free() during the rollback.

Link: https://lkml.kernel.org/r/20200831122631.28057-1-mbenes@suse.cz

Fixes: fc0ea795 ("ftrace: Add symbols for ftrace trampolines")
Fixes: f8b8be8a

 ("ftrace, kprobes: Support IPMODIFY flag to find IP modify conflict")
Signed-off-by: default avatarMiroslav Benes <mbenes@suse.cz>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 3031313e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment