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 <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 1432afb commit 9687bbf

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
@@ -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)