Skip to content

Commit fea3ffa

Browse files
Jiri Olsarostedt
authored andcommitted
ftrace: Add cleanup to unregister_ftrace_direct_multi
Adding ops cleanup to unregister_ftrace_direct_multi, so it can be reused in another register call. Link: https://lkml.kernel.org/r/[email protected] Cc: Ingo Molnar <[email protected]> Cc: Heiko Carstens <[email protected]> Fixes: f64dd46 ("ftrace: Add multi direct register/unregister interface") Signed-off-by: Jiri Olsa <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 7d5b7ca commit fea3ffa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kernel/trace/ftrace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5542,6 +5542,10 @@ int unregister_ftrace_direct_multi(struct ftrace_ops *ops, unsigned long addr)
55425542
err = unregister_ftrace_function(ops);
55435543
remove_direct_functions_hash(hash, addr);
55445544
mutex_unlock(&direct_mutex);
5545+
5546+
/* cleanup for possible another register call */
5547+
ops->func = NULL;
5548+
ops->trampoline = 0;
55455549
return err;
55465550
}
55475551
EXPORT_SYMBOL_GPL(unregister_ftrace_direct_multi);

0 commit comments

Comments
 (0)