Skip to content

Commit 9687bbf

Browse files
committed
ftrace: Use guard to take the ftrace_lock in release_probe()
The ftrace_lock is held throughout the entire release_probe() function. Use guard to simplify any exit paths. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/20241028071308.250787901@goodmis.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 1432afb commit 9687bbf

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

kernel/trace/ftrace.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5288,7 +5288,7 @@ static void release_probe(struct ftrace_func_probe *probe)
52885288
{
52895289
struct ftrace_probe_ops *probe_ops;
52905290

5291-
mutex_lock(&ftrace_lock);
5291+
guard(mutex)(&ftrace_lock);
52925292

52935293
WARN_ON(probe->ref <= 0);
52945294

@@ -5306,7 +5306,6 @@ static void release_probe(struct ftrace_func_probe *probe)
53065306
list_del(&probe->list);
53075307
kfree(probe);
53085308
}
5309-
mutex_unlock(&ftrace_lock);
53105309
}
53115310

53125311
static void acquire_probe_locked(struct ftrace_func_probe *probe)

0 commit comments

Comments
 (0)